package com.iformall.controller; import com.github.pagehelper.PageInfo; import com.iformall.annotation.AuthIgnore; import com.iformall.common.ErrorCode; import com.iformall.common.ResultData; import com.iformall.domain.po.base.BaseEntity; import com.iformall.domain.po.sm.MouldPatch; import com.iformall.domain.po.sm.PersonMould; import com.iformall.domain.po.sm.UserMouldVideo; import com.iformall.enums.EnumLanguages; import com.iformall.enums.EnumMouldPatchType; import com.iformall.enums.EnumMouldSendType; import com.iformall.enums.EnumaMouldPatchStatus; import com.iformall.language.LanguageDetect; import com.iformall.service.sm.MouldPatchService; import com.iformall.service.sm.MouldPatchSignService; import com.iformall.service.sm.PersonMouldService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RestController @RequestMapping("/api/personPatch") @Api(description = "模板接口") public class PersonMouldController extends BaseController { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired private PersonMouldService personMouldService; @Autowired private MouldPatchSignService mouldPatchSignService; @AuthIgnore @ApiOperation("分页列表接口") @GetMapping("list") @ApiImplicitParams({ @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) public ResultData list(@ModelAttribute PersonMould record, Integer pageNum, Integer pageSize) { logger.debug("[" + getIpAddr() + "] MouldPatchController::list"); if (record == null) record = new PersonMould(); if(record.getVideoType() != null && record.getVideoType().intValue() == -1){ record.setVideoType(null); } if(record.getSex() != null && record.getSex().intValue() == -1){ record.setSex(null); } // record.setSendType(EnumMouldSendType.auto.getCode()); record.setStatus(EnumaMouldPatchStatus.put_on.getCode()); record.setSortColumns(BaseEntity.SortField.UpdateDate_DESC); final PageInfo page = personMouldService.cListAsPage(record, pageNum, pageSize); return new ResultData(page); } @AuthIgnore @ApiOperation("根据id查询接口") @GetMapping("/findById") @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) public ResultData findById(Long id) { logger.debug("[" + getIpAddr() + "] MouldPatchController::findById"); PersonMould personMould = personMouldService.getDetailById(id); return new ResultData(personMould); } }