优化
This commit is contained in:
		| @ -0,0 +1,82 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.app.appup; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.CommonResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.AppUpRespVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpRespVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpSaveReqVO; | ||||
| import cn.iocoder.yudao.module.member.dal.dataobject.appup.AppUpDO; | ||||
| import cn.iocoder.yudao.module.member.service.appup.AppUpService; | ||||
| import io.swagger.v3.oas.annotations.Operation; | ||||
| import io.swagger.v3.oas.annotations.Parameter; | ||||
| import io.swagger.v3.oas.annotations.tags.Tag; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.web.bind.annotation.DeleteMapping; | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.PostMapping; | ||||
| import org.springframework.web.bind.annotation.PutMapping; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RequestParam; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
| import javax.validation.Valid; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||||
| import static cn.iocoder.yudao.framework.common.pojo.PageParam.PAGE_SIZE_NONE; | ||||
|  | ||||
| @Tag(name = "用户app - app更新") | ||||
| @RestController | ||||
| @RequestMapping("/member/app-up") | ||||
| @Validated | ||||
| public class AppAppUpController { | ||||
|  | ||||
|     @Resource | ||||
|     private AppUpService appUpService; | ||||
|  | ||||
|     @PostMapping("/create") | ||||
|     @Operation(summary = "创建app更新") | ||||
|     //@PreAuthorize("@ss.hasPermission('member:app-up:create')") | ||||
|     public CommonResult<Long> createAppUp(@Valid @RequestBody AppAppUpSaveReqVO createReqVO) { | ||||
|         return success(appUpService.createAppUp(createReqVO)); | ||||
|     } | ||||
|  | ||||
|     @PutMapping("/update") | ||||
|     @Operation(summary = "更新app更新") | ||||
|     //@PreAuthorize("@ss.hasPermission('member:app-up:update')") | ||||
|     public CommonResult<Boolean> updateAppUp(@Valid @RequestBody AppAppUpSaveReqVO updateReqVO) { | ||||
|         appUpService.updateAppUp(updateReqVO); | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|     @DeleteMapping("/delete") | ||||
|     @Operation(summary = "删除app更新") | ||||
|     @Parameter(name = "id", description = "编号", required = true) | ||||
|     //@PreAuthorize("@ss.hasPermission('member:app-up:delete')") | ||||
|     public CommonResult<Boolean> deleteAppUp(@RequestParam("id") Long id) { | ||||
|         appUpService.deleteAppUp(id); | ||||
|         return success(true); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/get") | ||||
|     @Operation(summary = "获得app更新") | ||||
|     @Parameter(name = "id", description = "编号", required = true, example = "1024") | ||||
|     //@PreAuthorize("@ss.hasPermission('member:app-up:query')") | ||||
|     public CommonResult<AppAppUpRespVO> getAppUp(@RequestParam("id") Long id) { | ||||
|         AppUpDO appUp = appUpService.getAppUp(id); | ||||
|         return success(BeanUtils.toBean(appUp, AppAppUpRespVO.class)); | ||||
|     } | ||||
|  | ||||
|     @GetMapping("/page") | ||||
|     @Operation(summary = "获得app更新分页") | ||||
|     //@PreAuthorize("@ss.hasPermission('member:app-up:query')") | ||||
|     public CommonResult<PageResult<AppUpRespVO>> getAppUpPage(@Valid AppAppUpPageReqVO pageReqVO) { | ||||
|         pageReqVO.setPageNo(PAGE_SIZE_NONE); | ||||
|         PageResult<AppUpDO> pageResult = appUpService.getAppUpPage(pageReqVO); | ||||
|         return success(BeanUtils.toBean(pageResult, AppUpRespVO.class)); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,42 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.app.appup.vo; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | ||||
| import org.springframework.format.annotation.DateTimeFormat; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||
|  | ||||
| @Schema(description = "管理后台 - app更新分页 Request VO") | ||||
| @Data | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @ToString(callSuper = true) | ||||
| public class AppAppUpPageReqVO extends PageParam { | ||||
|  | ||||
|     @Schema(description = "版本号") | ||||
|     private String version; | ||||
|  | ||||
|     @Schema(description = "更新方式", example = "2") | ||||
|     private String type; | ||||
|  | ||||
|     @Schema(description = "老版本号") | ||||
|     private String oldVersion; | ||||
|  | ||||
|     @Schema(description = "老版本号") | ||||
|     private String remarks; | ||||
|  | ||||
|     @Schema(description = "更新内容") | ||||
|     private String content; | ||||
|  | ||||
|     @Schema(description = "文件路径", example = "https://www.iocoder.cn") | ||||
|     private String fileUrl; | ||||
|  | ||||
|     @Schema(description = "创建时间") | ||||
|     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||
|     private LocalDateTime[] createTime; | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,47 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.app.appup.vo; | ||||
|  | ||||
| import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; | ||||
| import com.alibaba.excel.annotation.ExcelProperty; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @Schema(description = "管理后台 - app更新 Response VO") | ||||
| @Data | ||||
| @ExcelIgnoreUnannotated | ||||
| public class AppAppUpRespVO { | ||||
|  | ||||
|     @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12047") | ||||
|     @ExcelProperty("编号") | ||||
|     private Long id; | ||||
|  | ||||
|     @Schema(description = "版本号") | ||||
|     @ExcelProperty("版本号") | ||||
|     private String version; | ||||
|  | ||||
|     @Schema(description = "更新方式", example = "2") | ||||
|     @ExcelProperty("更新方式") | ||||
|     private String type; | ||||
|  | ||||
|     @Schema(description = "老版本号") | ||||
|     @ExcelProperty("老版本号") | ||||
|     private String oldVersion; | ||||
|  | ||||
|     @Schema(description = "老版本号") | ||||
|     @ExcelProperty("老版本号") | ||||
|     private String remarks; | ||||
|  | ||||
|     @Schema(description = "更新内容") | ||||
|     @ExcelProperty("更新内容") | ||||
|     private String content; | ||||
|  | ||||
|     @Schema(description = "文件路径", example = "https://www.iocoder.cn") | ||||
|     @ExcelProperty("文件路径") | ||||
|     private String fileUrl; | ||||
|  | ||||
|     @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) | ||||
|     @ExcelProperty("创建时间") | ||||
|     private LocalDateTime createTime; | ||||
|  | ||||
| } | ||||
| @ -0,0 +1,31 @@ | ||||
| package cn.iocoder.yudao.module.member.controller.app.appup.vo; | ||||
|  | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
|  | ||||
| @Schema(description = "管理后台 - app更新新增/修改 Request VO") | ||||
| @Data | ||||
| public class AppAppUpSaveReqVO { | ||||
|  | ||||
|     @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "12047") | ||||
|     private Long id; | ||||
|  | ||||
|     @Schema(description = "版本号") | ||||
|     private String version; | ||||
|  | ||||
|     @Schema(description = "更新方式", example = "2") | ||||
|     private String type; | ||||
|  | ||||
|     @Schema(description = "老版本号") | ||||
|     private String oldVersion; | ||||
|  | ||||
|     @Schema(description = "老版本号") | ||||
|     private String remarks; | ||||
|  | ||||
|     @Schema(description = "更新内容") | ||||
|     private String content; | ||||
|  | ||||
|     @Schema(description = "文件路径", example = "https://www.iocoder.cn") | ||||
|     private String fileUrl; | ||||
|  | ||||
| } | ||||
| @ -1,13 +1,12 @@ | ||||
| package cn.iocoder.yudao.module.member.dal.mysql.appup; | ||||
|  | ||||
| import java.util.*; | ||||
|  | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | ||||
| import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.AppUpPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.dal.dataobject.appup.AppUpDO; | ||||
| import org.apache.ibatis.annotations.Mapper; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.*; | ||||
|  | ||||
| /** | ||||
|  * app更新 Mapper | ||||
| @ -29,4 +28,17 @@ public interface AppUpMapper extends BaseMapperX<AppUpDO> { | ||||
|                 .orderByDesc(AppUpDO::getId)); | ||||
|     } | ||||
|  | ||||
|     default PageResult<AppUpDO> selectPage(AppAppUpPageReqVO reqVO) { | ||||
|         return selectPage(reqVO, new LambdaQueryWrapperX<AppUpDO>() | ||||
|                 .eqIfPresent(AppUpDO::getVersion, reqVO.getVersion()) | ||||
|                 .eqIfPresent(AppUpDO::getType, reqVO.getType()) | ||||
|                 .eqIfPresent(AppUpDO::getOldVersion, reqVO.getOldVersion()) | ||||
|                 .eqIfPresent(AppUpDO::getRemarks, reqVO.getRemarks()) | ||||
|                 .eqIfPresent(AppUpDO::getContent, reqVO.getContent()) | ||||
|                 .eqIfPresent(AppUpDO::getFileUrl, reqVO.getFileUrl()) | ||||
|                 .betweenIfPresent(AppUpDO::getCreateTime, reqVO.getCreateTime()) | ||||
|                 .orderByDesc(AppUpDO::getId)); | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
| @ -1,11 +1,13 @@ | ||||
| package cn.iocoder.yudao.module.member.service.appup; | ||||
|  | ||||
| import java.util.*; | ||||
| import javax.validation.*; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.*; | ||||
| import cn.iocoder.yudao.module.member.dal.dataobject.appup.AppUpDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.AppUpPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.AppUpSaveReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpSaveReqVO; | ||||
| import cn.iocoder.yudao.module.member.dal.dataobject.appup.AppUpDO; | ||||
|  | ||||
| import javax.validation.Valid; | ||||
|  | ||||
| /** | ||||
|  * app更新 Service 接口 | ||||
| @ -22,13 +24,14 @@ public interface AppUpService { | ||||
|      */ | ||||
|     Long createAppUp(@Valid AppUpSaveReqVO createReqVO); | ||||
|  | ||||
|     Long createAppUp(AppAppUpSaveReqVO createReqVO); | ||||
|     /** | ||||
|      * 更新app更新 | ||||
|      * | ||||
|      * @param updateReqVO 更新信息 | ||||
|      */ | ||||
|     void updateAppUp(@Valid AppUpSaveReqVO updateReqVO); | ||||
|  | ||||
|     void updateAppUp(@Valid AppAppUpSaveReqVO updateReqVO); | ||||
|     /** | ||||
|      * 删除app更新 | ||||
|      * | ||||
| @ -52,4 +55,5 @@ public interface AppUpService { | ||||
|      */ | ||||
|     PageResult<AppUpDO> getAppUpPage(AppUpPageReqVO pageReqVO); | ||||
|  | ||||
|     PageResult<AppUpDO> getAppUpPage(AppAppUpPageReqVO pageReqVO); | ||||
| } | ||||
| @ -1,21 +1,20 @@ | ||||
| package cn.iocoder.yudao.module.member.service.appup; | ||||
|  | ||||
| import org.springframework.stereotype.Service; | ||||
| import javax.annotation.Resource; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
|  | ||||
| import java.util.*; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.*; | ||||
| import cn.iocoder.yudao.module.member.dal.dataobject.appup.AppUpDO; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||||
| import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||||
| import cn.iocoder.yudao.framework.common.util.object.BeanUtils; | ||||
|  | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.AppUpPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.admin.appup.vo.AppUpSaveReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpPageReqVO; | ||||
| import cn.iocoder.yudao.module.member.controller.app.appup.vo.AppAppUpSaveReqVO; | ||||
| import cn.iocoder.yudao.module.member.dal.dataobject.appup.AppUpDO; | ||||
| import cn.iocoder.yudao.module.member.dal.mysql.appup.AppUpMapper; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.validation.annotation.Validated; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
|  | ||||
| import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | ||||
| import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; | ||||
| import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.APP_UP_NOT_EXISTS; | ||||
|  | ||||
| /** | ||||
|  * app更新 Service 实现类 | ||||
| @ -38,6 +37,15 @@ public class AppUpServiceImpl implements AppUpService { | ||||
|         return appUp.getId(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public Long createAppUp(AppAppUpSaveReqVO createReqVO) { | ||||
|         // 插入 | ||||
|         AppUpDO appUp = BeanUtils.toBean(createReqVO, AppUpDO.class); | ||||
|         appUpMapper.insert(appUp); | ||||
|         // 返回 | ||||
|         return appUp.getId(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void updateAppUp(AppUpSaveReqVO updateReqVO) { | ||||
|         // 校验存在 | ||||
| @ -47,6 +55,15 @@ public class AppUpServiceImpl implements AppUpService { | ||||
|         appUpMapper.updateById(updateObj); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void updateAppUp(AppAppUpSaveReqVO updateReqVO) { | ||||
|         // 校验存在 | ||||
|         validateAppUpExists(updateReqVO.getId()); | ||||
|         // 更新 | ||||
|         AppUpDO updateObj = BeanUtils.toBean(updateReqVO, AppUpDO.class); | ||||
|         appUpMapper.updateById(updateObj); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void deleteAppUp(Long id) { | ||||
|         // 校验存在 | ||||
| @ -71,4 +88,10 @@ public class AppUpServiceImpl implements AppUpService { | ||||
|         return appUpMapper.selectPage(pageReqVO); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public PageResult<AppUpDO> getAppUpPage(AppAppUpPageReqVO pageReqVO) { | ||||
|         return appUpMapper.selectPage(pageReqVO); | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
| @ -265,9 +265,9 @@ public class DiningPlatesServiceImpl implements DiningPlatesService { | ||||
|                 throw exception(CARD_NOT_BIND_USER); | ||||
|             } | ||||
|         } | ||||
|         if (StrUtil.isBlank(memberUserDo.getCardId())) { | ||||
|             throw exception(CARD_NOT_BIND); | ||||
|         } | ||||
|         //if (StrUtil.isBlank(memberUserDo.getCardId())) { | ||||
|         //    throw exception(CARD_NOT_BIND); | ||||
|         //} | ||||
|     } | ||||
|  | ||||
|     public void checkMoney(BigDecimal money) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 zengtao01
					zengtao01