package com.blueland.sys.app.web;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.blueland.result.R;
import com.blueland.service.IAdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.blueland.bo.AdminUserEntity;


@RestController
@RequestMapping(value = "/adminUser")
public class AdminUserRest {

    @Autowired
    IAdminUserService adminUserService;

    /**
     * 搜索对象
     **/
    @RequestMapping(value = "", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    @ResponseBody
    @CrossOrigin
    public R<Page<AdminUserEntity>> list(AdminUserEntity adminUserEntry) {
        Page<AdminUserEntity> page = this.adminUserService.findPage(adminUserEntry);
        return R.ok(page);
    }

    /**
     * 搜索对象
     **/
    @RequestMapping(value = "/getByAppidAndUsercode/{appId}/{userId}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    @ResponseBody
    @CrossOrigin
    public R<AdminUserEntity> getByAppidAndUsercode(@PathVariable("appId") String appId, @PathVariable("userId") String userId) {
        AdminUserEntity adminUserEntity = this.adminUserService.getByAppidAndUsercode(appId, userId);
        return R.ok(adminUserEntity);
    }

}



