商品品牛排和规格,代码 REVIEW

This commit is contained in:
YunaiV 2020-05-11 21:55:53 +08:00
parent b45739d151
commit a8bc6754c2
4 changed files with 7 additions and 2 deletions

View File

@ -13,6 +13,7 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface ProductBrandMapper extends BaseMapper<ProductBrandDO> { public interface ProductBrandMapper extends BaseMapper<ProductBrandDO> {
// TODO FROM 芋艿 to q2118csselectPageByParams
default IPage<ProductBrandDO> selectListByParams(ProductBrandPageDTO productBrandPageDTO) { default IPage<ProductBrandDO> selectListByParams(ProductBrandPageDTO productBrandPageDTO) {
Page<ProductBrandDO> page = new Page<>(productBrandPageDTO.getPageNo(), productBrandPageDTO.getPageSize()); Page<ProductBrandDO> page = new Page<>(productBrandPageDTO.getPageNo(), productBrandPageDTO.getPageSize());
LambdaQueryWrapper<ProductBrandDO> queryWrapper = Wrappers.<ProductBrandDO>query().lambda() LambdaQueryWrapper<ProductBrandDO> queryWrapper = Wrappers.<ProductBrandDO>query().lambda()

View File

@ -24,9 +24,10 @@ import static cn.iocoder.common.framework.vo.CommonResult.success;
@RestController @RestController
@RequestMapping("admins/brand") @RequestMapping("admins/brand")
@Api("商品品牌") @Api("商品品牌") // TODO FROM 芋艿 to q2118cs管理员 - 商品品牌 API哈哈哈原来没规范
public class AdminsProductBrandController { public class AdminsProductBrandController {
// TODO FROM 芋艿 to q2118cs貌似没注入哈
private ProductBrandService productBrandService; private ProductBrandService productBrandService;
@PostMapping("/add") @PostMapping("/add")
@ -49,6 +50,7 @@ public class AdminsProductBrandController {
@ApiImplicitParam(name = "picUrl", value = "品牌图片", required = true, example = "http://www.iocoder.cn"), @ApiImplicitParam(name = "picUrl", value = "品牌图片", required = true, example = "http://www.iocoder.cn"),
@ApiImplicitParam(name = "status", value = "状态 1开启 2禁用", required = true, example = "1") @ApiImplicitParam(name = "status", value = "状态 1开启 2禁用", required = true, example = "1")
}) })
// TODO FROM 芋艿 to q2118cs只要改成了 bean 接收就不用在写 @ApiImplicitParam 注解啦直接在 bean 里写就 ok
public CommonResult<Boolean> update(@Validated ProductBrandUpdateRequest updateRequest) { public CommonResult<Boolean> update(@Validated ProductBrandUpdateRequest updateRequest) {
// 创建 productBrandUpdateDTO 对象 // 创建 productBrandUpdateDTO 对象
ProductBrandUpdateDTO productBrandUpdateDTO = ProductBrandConvert.INSTANCE.convertUpdate(updateRequest); ProductBrandUpdateDTO productBrandUpdateDTO = ProductBrandConvert.INSTANCE.convertUpdate(updateRequest);

View File

@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("users/favorite") @RequestMapping("users/favorite")
@Api("用户收藏") @Api("用户收藏")
// TODO FROM 芋艿 to ilnhjcontroller 分包的话还是按照模块然后通过 Admins Users 前缀区分不同的 Controlller
public class UserFavoriteController { public class UserFavoriteController {
} }

View File

@ -15,6 +15,7 @@ public enum UserErrorCodeEnum implements ServiceExceptionUtil.Enumerable {
USER_GET_ADDRESS_NOT_EXISTS(1001004002, "获取的地址不存在!"), USER_GET_ADDRESS_NOT_EXISTS(1001004002, "获取的地址不存在!"),
// ========== 用户 ========== // ========== 用户 ==========
// TODO FROM 芋艿 to linhj是不是提示不对呀
USER_NOT_EXISTS(1001004003, "获取的地址不存在!"), USER_NOT_EXISTS(1001004003, "获取的地址不存在!"),
; ;