员工信息获取接口

This commit is contained in:
张松 2025-03-03 13:57:30 +08:00
parent 2e4f0ced7e
commit 366ed9aa8c
1 changed files with 14 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import com.czg.annotation.SaAdminCheckPermission;
import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.QueryWrapper;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -51,6 +52,19 @@ public class ShopStaffController {
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