| | |
| | | import com.java110.doc.annotation.Java110ParamDoc; |
| | | import com.java110.doc.annotation.Java110ParamsDoc; |
| | | import com.java110.dto.smallProgramAdvert.QuertAdvertDto; |
| | | import com.java110.dto.smallProgramAdvert.SmallProgramAdvertDto; |
| | | import com.java110.intf.common.ISmallProgramAdvertServiceSMO; |
| | | import com.java110.utils.exception.CmdException; |
| | | import com.java110.utils.util.Assert; |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Override |
| | | public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "position", "广告位"); |
| | | Assert.hasKeyAndValue(reqJson, "position", "广告位必传"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | quertAdvertDto.setRow(10000); |
| | | quertAdvertDto.setStatus(1); |
| | | ResultVo resultVo = smallProgramAdvertService.querySmallAdverts(quertAdvertDto); |
| | | Object object = resultVo.getData(); |
| | | if(object != null){ |
| | | List<SmallProgramAdvertDto> smallProgramAdvertListDtoList = (List<SmallProgramAdvertDto>)object; |
| | | List<SmallProgramAdvertDto> sortedByAsc = smallProgramAdvertListDtoList.stream() |
| | | .sorted((p1, p2) -> Integer.compare(p1.getSort(), p2.getSort())) |
| | | .collect(Collectors.toList()); |
| | | resultVo.setData(sortedByAsc); |
| | | } |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | } |