店铺信息修改
This commit is contained in:
parent
3db724435c
commit
e1581a60b4
|
|
@ -9,6 +9,7 @@ import com.czg.account.service.ShopInfoService;
|
|||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaAdminCheckRole;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -42,11 +43,14 @@ public class ShopInfoController {
|
|||
* 店铺详情
|
||||
* 权限标识: shopInfo:detail
|
||||
*/
|
||||
@SaAdminCheckPermission("shopInfo:detail")
|
||||
// @SaAdminCheckPermission("shopInfo:detail")
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<ShopDetailDTO> detail(Integer id) {
|
||||
public CzgResult<ShopDetailDTO> detail(Long id) {
|
||||
if (StpKit.USER.isAdmin() || StpKit.USER.getShopId().equals(id)) {
|
||||
return CzgResult.success(shopInfoService.detail(id));
|
||||
}
|
||||
return CzgResult.failure("店铺信息不存在");
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺添加, 只允许管理员调用
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public interface ShopInfoService extends IService<ShopInfo> {
|
|||
|
||||
Boolean edit(ShopInfoEditDTO shopInfoEditDTO);
|
||||
|
||||
ShopDetailDTO detail(Integer id);
|
||||
ShopDetailDTO detail(Long id);
|
||||
|
||||
ShopInfoByCodeDTO getByCode(String tableCode, String lat, String lng, boolean checkState);
|
||||
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public class ShopInfoServiceImpl extends ServiceImpl<ShopInfoMapper, ShopInfo> i
|
|||
}
|
||||
|
||||
@Override
|
||||
public ShopDetailDTO detail(Integer id) {
|
||||
public ShopDetailDTO detail(Long id) {
|
||||
ShopInfo shopInfo = queryChain().eq(ShopInfo::getId, id == null ? StpKit.USER.getShopId() : id).one();
|
||||
if (shopInfo == null) {
|
||||
throw new ApiNotPrintException("店铺信息不存在");
|
||||
|
|
|
|||
Loading…
Reference in New Issue