员工信息获取接口
This commit is contained in:
@@ -9,6 +9,7 @@ import com.czg.annotation.SaAdminCheckPermission;
|
|||||||
import com.czg.resp.CzgResult;
|
import com.czg.resp.CzgResult;
|
||||||
import com.czg.sa.StpKit;
|
import com.czg.sa.StpKit;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -51,6 +52,19 @@ public class ShopStaffController {
|
|||||||
return CzgResult.success(shopStaffService.permission(id));
|
return CzgResult.success(shopStaffService.permission(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前登录员工信息
|
||||||
|
* @return 员工信息
|
||||||
|
*/
|
||||||
|
@GetMapping("/info")
|
||||||
|
public CzgResult<ShopStaff> info() {
|
||||||
|
if (StpKit.USER.isStaff()) {
|
||||||
|
return CzgResult.success(shopStaffService.getOne(new QueryWrapper().eq(ShopStaff::getShopId, StpKit.USER.getShopId()).eq(ShopStaff::getId, StpKit.USER.getLoginIdAsLong())));
|
||||||
|
}
|
||||||
|
|
||||||
|
return CzgResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工详情
|
* 员工详情
|
||||||
* 权限标识: shopStaff:detail
|
* 权限标识: shopStaff:detail
|
||||||
|
|||||||
Reference in New Issue
Block a user