代码生成

This commit is contained in:
李广豪 2021-11-08 09:05:11 +08:00
parent 82bc449551
commit 0ca9cf8e37
10 changed files with 3 additions and 469 deletions

View File

@ -33,7 +33,7 @@ import java.util.List;
* @Version 1.0
*/
@RestController
@RequestMapping(CommonConstant.API_MODULE_BASE + "basic")
@RequestMapping(CommonConstant.API_MODULE_BASE + "alarmBase")
@Slf4j
@Api(value = "报警基础信息管理", tags = "报警基础信息管理", hidden = false)
public class AlarmBaseController extends BaseController {

View File

@ -1,99 +0,0 @@
package com.mt.wms.basic.controller;
import com.mt.wms.basic.params.EmptyParam;
import com.mt.wms.basic.params.EmptyQueryParam;
import com.mt.wms.basic.service.EmptyService;
import com.mt.wms.basic.vo.EmptyVo;
import com.mt.wms.core.base.BaseController;
import com.mt.wms.core.constants.CommonConstant;
import com.mt.wms.core.params.EnabledParam;
import com.mt.wms.core.params.IdListParam;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.validator.groups.AddGroup;
import com.mt.wms.core.validator.groups.PageGroup;
import com.mt.wms.core.validator.groups.UpdateGroup;
import com.mt.wms.core.vo.IdListVo;
import com.mt.wms.core.vo.IdVo;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.groups.Default;
import java.util.List;
/**
* @author jiff
* @date 2020/12/22
* @since 1.0
*/
@RestController
@RequestMapping(CommonConstant.API_MODULE_BASE + "empty")
@Slf4j
@Api(value = "xx管理", tags = "xx", hidden = false)
public class EmptyController extends BaseController {
@Autowired
private EmptyService emptyService;
@PostMapping(value = "get")
@ApiOperation(value = "获取xx")
private R<EmptyVo> get(@Validated @RequestBody IdParam idParam) {
return emptyService.get(idParam);
}
@PostMapping(value = "list")
@ApiOperation(value = "获取xx列表")
private R<List<EmptyVo>> list(@Validated({Default.class}) @RequestBody EmptyQueryParam emptyQueryParam) {
return emptyService.list(emptyQueryParam);
}
@PostMapping(value = "page")
@ApiOperation(value = "获取分页xx")
private R<PageVo<EmptyVo>> page(@Validated({PageGroup.class, Default.class}) @RequestBody EmptyQueryParam emptyQueryParam) {
return emptyService.page(emptyQueryParam);
}
@PostMapping(value = "tree")
@ApiOperation(value = "获取xx树列表")
private R<List<EmptyVo>> tree(@Validated({Default.class}) @RequestBody EmptyQueryParam emptyQueryParam) {
return emptyService.tree(emptyQueryParam);
}
@PostMapping(value = "add")
@ApiOperation(value = "新增")
private R<IdVo> add(@Validated({AddGroup.class, Default.class}) @RequestBody EmptyParam emptyParam) {
return emptyService.add(emptyParam);
}
@PostMapping(value = "update")
@ApiOperation(value = "更新")
private R<IdVo> update(@Validated({UpdateGroup.class, Default.class}) @RequestBody EmptyParam emptyParam) {
return emptyService.update(emptyParam);
}
@PostMapping(value = "enabled")
@ApiOperation(value = "启停xx")
private R<IdVo> enabled(@Validated @RequestBody EnabledParam enabledParam) {
return emptyService.enabled(enabledParam);
}
@PostMapping(value = "delete")
@ApiOperation(value = "删除xx")
private R<IdVo> delete(@Validated @RequestBody IdParam idParam) {
return emptyService.delete(idParam);
}
@PostMapping(value = "batchDelete")
@ApiOperation(value = "批量删除xx")
private R<IdListVo> delete(@Validated @RequestBody IdListParam idListParam) {
return emptyService.delete(idListParam);
}
}

View File

@ -1,11 +1,9 @@
package com.mt.wms.basic.controller;
import com.mt.wms.basic.params.EmptyParam;
import com.mt.wms.basic.params.EmptyQueryParam;
import com.mt.wms.basic.params.WarehouseParam;
import com.mt.wms.basic.params.WarehouseQueryParam;
import com.mt.wms.basic.service.WarehouseService;
import com.mt.wms.basic.vo.EmptyVo;
import com.mt.wms.basic.vo.WarehouseVo;
import com.mt.wms.core.base.BaseController;
import com.mt.wms.core.constants.CommonConstant;
@ -37,7 +35,7 @@ import java.util.List;
* @Version 1.0
*/
@RestController
@RequestMapping(CommonConstant.API_MODULE_BASE + "basic")
@RequestMapping(CommonConstant.API_MODULE_BASE + "warehouse")
@Slf4j
@Api(value = "缓存区管理", tags = "缓存区管理", hidden = false)
public class WarehouseController extends BaseController {

View File

@ -1,28 +0,0 @@
package com.mt.wms.basic.mapper;
import com.mt.wms.basic.vo.EmptyVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* xxmapper类
*
* @author jiff
* @date 2018/11/9
* @since 1.0
*/
@Repository
public interface EmptyMapper {
/**
* 获取xx列表
*
* @param id ID
* @param category 分类
* @return xx列表
*/
List<EmptyVo> listBy(@Param("id") Long id, @Param("category") Integer category);
}

View File

@ -1,40 +0,0 @@
package com.mt.wms.basic.params;
import com.mt.wms.core.base.BaseParam;
import com.mt.wms.core.validator.groups.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* @author jiff
* @date 2020/12/22
* @since 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "xx参数对象", description = "用于新增和更新xx信息")
public class EmptyParam extends BaseParam {
private static final long serialVersionUID = 1L;
/**
* 主键自增
*/
@ApiModelProperty(value = "主键,更新时需要填写", example = "1")
@NotNull(message = "xxID不能为空", groups = {UpdateGroup.class})
private Long id;
/**
* xx名称
*/
@ApiModelProperty(value = "xx名称", required = true, example = "xx管理")
@NotBlank(message = "xx名称不能为空")
private String name;
}

View File

@ -1,27 +0,0 @@
package com.mt.wms.basic.params;
import com.mt.wms.core.params.BasePageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @author jiff
* @date 2020/12/22
* @since 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "xx查询参数", description = "用于查询xx信息")
public class EmptyQueryParam extends BasePageParam {
/**
* xx名称
*/
@ApiModelProperty(value = "xx名称", required = false, example = "xx管理")
private String name;
}

View File

@ -1,94 +0,0 @@
package com.mt.wms.basic.service;
import com.mt.wms.basic.params.EmptyParam;
import com.mt.wms.basic.params.EmptyQueryParam;
import com.mt.wms.basic.vo.EmptyVo;
import com.mt.wms.core.params.EnabledParam;
import com.mt.wms.core.params.IdListParam;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.vo.IdListVo;
import com.mt.wms.core.vo.IdVo;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
import java.util.List;
/**
* xx服务
*
* @author jiff
* @date 2020/12/22
* @since 1.0
*/
public interface EmptyService {
/**
* 获取xx
*
* @param idParam 主键参数
* @return xx
*/
R<EmptyVo> get(IdParam idParam);
/**
* 获取xx列表
*
* @param emptyQueryParam xx查询参数
* @return xx列表
*/
R<List<EmptyVo>> list(EmptyQueryParam emptyQueryParam);
/**
* 获取xx分页列表
*
* @param emptyQueryParam xx查询参数
* @return xx分页列表
*/
R<PageVo<EmptyVo>> page(EmptyQueryParam emptyQueryParam);
/**
* 获取xx树列表
*
* @param emptyQueryParam xx查询参数
* @return xx树列表
*/
R<List<EmptyVo>> tree(EmptyQueryParam emptyQueryParam);
/**
* 新增xx
*
* @param emptyParam xx参数
* @return 主键
*/
R<IdVo> add(EmptyParam emptyParam);
/**
* 更新xx
*
* @param emptyParam xx参数
* @return 主键
*/
R<IdVo> update(EmptyParam emptyParam);
/**
* 启用停用
*
* @param enabledParam 启停参数
* @return 主键
*/
R<IdVo> enabled(EnabledParam enabledParam);
/**
* 删除xx
*
* @param idParam 主键参数
* @return 主键
*/
R<IdVo> delete(IdParam idParam);
/**
* 批量删除xx
*
* @param idListParam 主键列表参数
* @return 主键列表
*/
R<IdListVo> delete(IdListParam idListParam);
}

View File

@ -1,10 +1,7 @@
package com.mt.wms.basic.service;
import com.mt.wms.basic.params.EmptyParam;
import com.mt.wms.basic.params.EmptyQueryParam;
import com.mt.wms.basic.params.WarehouseParam;
import com.mt.wms.basic.params.WarehouseQueryParam;
import com.mt.wms.basic.vo.EmptyVo;
import com.mt.wms.basic.vo.WarehouseVo;
import com.mt.wms.core.params.EnabledParam;
import com.mt.wms.core.params.IdParam;

View File

@ -1,128 +0,0 @@
package com.mt.wms.basic.service.impl;
import com.mt.wms.basic.params.EmptyParam;
import com.mt.wms.basic.params.EmptyQueryParam;
import com.mt.wms.basic.service.EmptyService;
import com.mt.wms.basic.vo.EmptyVo;
import com.mt.wms.core.base.BaseService;
import com.mt.wms.core.params.EnabledParam;
import com.mt.wms.core.params.IdListParam;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.vo.IdListVo;
import com.mt.wms.core.vo.IdVo;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* xx服务实现类
*
* @author jiff
* @date 2020/12/22
* @since 1.0
*/
@Service
@Transactional
public class EmptyServiceImpl extends BaseService implements EmptyService {
/**
* 获取xx
*
* @param idParam 主键参数
* @return xx
*/
@Override
public R<EmptyVo> get(IdParam idParam) {
return null;
}
/**
* 获取xx列表
*
* @param emptyQueryParam xx查询参数
* @return xx列表
*/
@Override
public R<List<EmptyVo>> list(EmptyQueryParam emptyQueryParam) {
return null;
}
/**
* 获取xx分页列表
*
* @param emptyQueryParam xx查询参数
* @return xx分页列表
*/
@Override
public R<PageVo<EmptyVo>> page(EmptyQueryParam emptyQueryParam) {
return null;
}
/**
* 获取xx树列表
*
* @param emptyQueryParam xx查询参数
* @return xx树列表
*/
@Override
public R<List<EmptyVo>> tree(EmptyQueryParam emptyQueryParam) {
return null;
}
/**
* 新增xx
*
* @param emptyParam xx参数
* @return 主键
*/
@Override
public R<IdVo> add(EmptyParam emptyParam) {
return null;
}
/**
* 更新xx
*
* @param emptyParam xx参数
* @return 主键
*/
@Override
public R<IdVo> update(EmptyParam emptyParam) {
return null;
}
/**
* 启用停用
*
* @param enabledParam 启停参数
* @return 主键
*/
@Override
public R<IdVo> enabled(EnabledParam enabledParam) {
return null;
}
/**
* 删除xx
*
* @param idParam 主键参数
* @return 主键
*/
@Override
public R<IdVo> delete(IdParam idParam) {
return null;
}
/**
* 批量删除xx
*
* @param idListParam 主键列表参数
* @return 主键列表
*/
@Override
public R<IdListVo> delete(IdListParam idListParam) {
return null;
}
}

View File

@ -1,45 +0,0 @@
package com.mt.wms.basic.vo;
import com.mt.wms.core.base.BaseVo;
import com.mt.wms.core.base.ITree;
import com.mt.wms.core.vo.PageVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
*
* @author jiff
* @date 2020/12/22
* @since 1.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@ApiModel(value = "xx视图对象", description = "用于查询xx信息")
public class EmptyVo extends BaseVo implements PageVo.ConvertVo, ITree<EmptyVo> {
/**
* 主键自增
*/
@ApiModelProperty(value = "主键", required = true, example = "1")
@NotNull(message = "ID不能为空")
private Long id;
/**
* 父xxID
*/
@ApiModelProperty(value = "父xxID", example = "0")
@NotNull(message = "父xx不能为空")
private Long parentId;
/**
* 子列表
*/
@ApiModelProperty(value = "子列表用于获取xx树时才有数据", required = false)
private List<EmptyVo> children;
}