parent
eb224416d5
commit
985bdd5611
@ -1,102 +0,0 @@
|
|||||||
package ${basePackage}.module.system.req;
|
|
||||||
|
|
||||||
import org.hibernate.validator.constraints.Length;
|
|
||||||
import ${basePackage}.frame.base.BaseRequest;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceCreateRequest - 序列新增
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceCreateRequest extends BaseRequest {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 序列名称.
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "[seqName]序列名称不能为空")
|
|
||||||
@Length(min = 0, max = 50, message = "[seqName]序列名称长度不合法(0-50)")
|
|
||||||
private String seqName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 序列备注.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 50, message = "[seqNote]序列备注长度不合法(0-50)")
|
|
||||||
private String seqNote;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 年.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 4, message = "[year]年长度不合法(0-4)")
|
|
||||||
private String year;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 月.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 2, message = "[month]月长度不合法(0-2)")
|
|
||||||
private String month;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 2, message = "[date]日长度不合法(0-2)")
|
|
||||||
private String date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下一个值.
|
|
||||||
*/
|
|
||||||
@NotNull(message = "[nextValue]下一个值不能为NULL")
|
|
||||||
private Integer nextValue;
|
|
||||||
|
|
||||||
public String getSeqName() {
|
|
||||||
return this.seqName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeqName(String seqName) {
|
|
||||||
this.seqName = seqName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSeqNote() {
|
|
||||||
return this.seqNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeqNote(String seqNote) {
|
|
||||||
this.seqNote = seqNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getYear() {
|
|
||||||
return this.year;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setYear(String year) {
|
|
||||||
this.year = year;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMonth() {
|
|
||||||
return this.month;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMonth(String month) {
|
|
||||||
this.month = month;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDate() {
|
|
||||||
return this.date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDate(String date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNextValue() {
|
|
||||||
return this.nextValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNextValue(Integer nextValue) {
|
|
||||||
this.nextValue = nextValue;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
package ${basePackage}.module.system.req;
|
|
||||||
|
|
||||||
import ${basePackage}.frame.base.BaseRequest;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceDeleteRequest - 序列删除
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceDeleteRequest extends BaseRequest {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键.
|
|
||||||
*/
|
|
||||||
@NotNull(message = "[id]主键不能为空")
|
|
||||||
private long id;
|
|
||||||
|
|
||||||
public long getId() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,93 +0,0 @@
|
|||||||
package ${basePackage}.module.system.req;
|
|
||||||
|
|
||||||
import ${basePackage}.frame.base.BaseFindRequest;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceFindRequest - 序列查询
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceFindRequest extends BaseFindRequest {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 序列名称.
|
|
||||||
*/
|
|
||||||
private String seqName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 年.
|
|
||||||
*/
|
|
||||||
private String year;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 月.
|
|
||||||
*/
|
|
||||||
private String month;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日.
|
|
||||||
*/
|
|
||||||
private String date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始日期
|
|
||||||
*/
|
|
||||||
private Date startDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 结束日期
|
|
||||||
*/
|
|
||||||
private Date endDate;
|
|
||||||
|
|
||||||
public String getSeqName() {
|
|
||||||
return this.seqName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeqName(String seqName) {
|
|
||||||
this.seqName = seqName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getYear() {
|
|
||||||
return this.year;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setYear(String year) {
|
|
||||||
this.year = year;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMonth() {
|
|
||||||
return this.month;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMonth(String month) {
|
|
||||||
this.month = month;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDate() {
|
|
||||||
return this.date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDate(String date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getStartDate() {
|
|
||||||
return startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStartDate(Date startDate) {
|
|
||||||
this.startDate = startDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getEndDate() {
|
|
||||||
return endDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEndDate(Date endDate) {
|
|
||||||
this.endDate = endDate;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,116 +0,0 @@
|
|||||||
package ${basePackage}.module.system.req;
|
|
||||||
|
|
||||||
import org.hibernate.validator.constraints.Length;
|
|
||||||
import ${basePackage}.frame.base.BaseUpdateRequest;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceUpdateRequest - 序列更新
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceUpdateRequest extends BaseUpdateRequest {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键.
|
|
||||||
*/
|
|
||||||
@NotNull(message = "[id]主键不能为NULL")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 序列名称.
|
|
||||||
*/
|
|
||||||
@NotBlank(message = "[seqName]序列名称不能为空")
|
|
||||||
@Length(min = 0, max = 50, message = "[seqName]序列名称长度不合法(0-50)")
|
|
||||||
private String seqName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 序列备注.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 50, message = "[seqNote]序列备注长度不合法(0-50)")
|
|
||||||
private String seqNote;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 年.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 4, message = "[year]年长度不合法(0-4)")
|
|
||||||
private String year;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 月.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 2, message = "[month]月长度不合法(0-2)")
|
|
||||||
private String month;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 日.
|
|
||||||
*/
|
|
||||||
@Length(min = 0, max = 2, message = "[date]日长度不合法(0-2)")
|
|
||||||
private String date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 下一个值.
|
|
||||||
*/
|
|
||||||
@NotNull(message = "[nextValue]下一个值不能为NULL")
|
|
||||||
private Integer nextValue;
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSeqName() {
|
|
||||||
return this.seqName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeqName(String seqName) {
|
|
||||||
this.seqName = seqName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSeqNote() {
|
|
||||||
return this.seqNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSeqNote(String seqNote) {
|
|
||||||
this.seqNote = seqNote;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getYear() {
|
|
||||||
return this.year;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setYear(String year) {
|
|
||||||
this.year = year;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMonth() {
|
|
||||||
return this.month;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMonth(String month) {
|
|
||||||
this.month = month;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDate() {
|
|
||||||
return this.date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDate(String date) {
|
|
||||||
this.date = date;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNextValue() {
|
|
||||||
return this.nextValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNextValue(Integer nextValue) {
|
|
||||||
this.nextValue = nextValue;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package ${basePackage}.module.system.rsp;
|
|
||||||
|
|
||||||
import ${basePackage}.frame.base.BaseResponse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceCreateResponse - 序列
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceCreateResponse extends BaseResponse {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 主键
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
public Long getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Long id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package ${basePackage}.module.system.rsp;
|
|
||||||
|
|
||||||
import ${basePackage}.frame.base.BaseResponse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceDeleteResponse - 序列
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceDeleteResponse extends BaseResponse {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除数目
|
|
||||||
*/
|
|
||||||
private Long result;
|
|
||||||
|
|
||||||
public Long getResult() {
|
|
||||||
return this.result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResult(Long result) {
|
|
||||||
this.result = result;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
package ${basePackage}.module.system.rsp;
|
|
||||||
|
|
||||||
import ${basePackage}.frame.base.BaseFindResponse;
|
|
||||||
import ${basePackage}.module.system.ent.Sequence;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceFindResponse - 序列
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceFindResponse extends BaseFindResponse<Sequence> {
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
package ${basePackage}.module.system.rsp;
|
|
||||||
|
|
||||||
import ${basePackage}.frame.base.BaseResponse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SequenceUpdateResponse - 序列
|
|
||||||
*
|
|
||||||
* @author wangbing
|
|
||||||
* @version 0.0.1
|
|
||||||
* @since 2020-06-25
|
|
||||||
*/
|
|
||||||
public class SequenceUpdateResponse extends BaseResponse {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新数目
|
|
||||||
*/
|
|
||||||
private Long result;
|
|
||||||
|
|
||||||
public Long getResult() {
|
|
||||||
return this.result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setResult(Long result) {
|
|
||||||
this.result = result;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,52 @@
|
|||||||
|
package modules.SpringBoot.test.system;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import xyz.wbsite.frame.auth.Token;
|
||||||
|
import xyz.wbsite.frame.utils.MapperUtil;
|
||||||
|
import xyz.wbsite.module.system.mgr.SequenceManager;
|
||||||
|
import xyz.wbsite.module.system.req.SequenceGetRequest;
|
||||||
|
import xyz.wbsite.module.system.rsp.SequenceGetResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SequenceTest - - 序列测试用例
|
||||||
|
*
|
||||||
|
* @author wangbing
|
||||||
|
* @version 0.0.1
|
||||||
|
* @since 2020-06-25
|
||||||
|
*/
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest
|
||||||
|
@Transactional
|
||||||
|
public class SequenceTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Token token;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SequenceManager sequenceManager;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testGet() {
|
||||||
|
SequenceGetRequest request = new SequenceGetRequest();
|
||||||
|
request.setSeqName("测试");
|
||||||
|
request.setSeqNote("测试");
|
||||||
|
request.setSeqPrefix("CS");
|
||||||
|
request.setMaxValue(999);
|
||||||
|
request.setByYear(true);
|
||||||
|
request.setByMonth(false);
|
||||||
|
request.setByDate(false);
|
||||||
|
|
||||||
|
for (int i = 0; i < 1000; i++) {
|
||||||
|
SequenceGetResponse response = sequenceManager.get(request, token);
|
||||||
|
System.out.println("=================================================================================");
|
||||||
|
System.out.println(response.getSequence());
|
||||||
|
if (response.hasError()) System.err.println(MapperUtil.toJson(response));
|
||||||
|
System.out.println("=================================================================================");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue