首页 > 编程语言 >关于java中VO,DTO的理解

关于java中VO,DTO的理解

时间:2022-10-23 15:23:38浏览次数:39  
标签:java String allDto private VO dept new DTO public

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class AllCodeCoverageRateSettingDto {
private Integer id;
private String dept;
private Long createTime;
private Long updateTime;
private Date dbUpdateTime;
private Date dbCreateTime;
}

以下是dao层

@Mapper
public interface AllDao {

int editSetting(AllDto allCodeCoverageRateSettingDto);
List<AllDto> querySettingByDept(String dept);
List<AllDto> querySettingAll();

}


以下是service层

@Service
public class AllServiceImpl implements IAllService {

@Autowired
AllDao allDao;

@Override
public Response editSetting(String dept, String executionSet) throws Exception {
    AllDto allDto = new AllDto();
    allDto.setDept(dept);
    allDto.setSet(executionSet);
    Long ts = System.currentTimeMillis()+8*60*60*1000;
    allDto.setUpdateTime(ts);
    allDto.setDbUpdateTime(new Timestamp(ts));
    try{
        allDao.editSetting(allDto);
    }catch (Exception e){
        return new Response(ResultCode.GLOBAL_PROJECT_SYSTEM_ERROR,e.getMessage(),"更新失败");
    }
    return new Response(ResultCode.GLOBAL_SUCCESSFUL,null,"更新成功",0);
}

标签:java,String,allDto,private,VO,dept,new,DTO,public
From: https://www.cnblogs.com/dongye95/p/16818619.html

相关文章