| | |
| | | package com.kidgrow.oprationcenter.controller; |
| | | |
| | | import java.util.Map; |
| | | import com.kidgrow.common.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.kidgrow.common.model.PageResult; |
| | | import com.kidgrow.common.model.ResultBody; |
| | | import com.kidgrow.oprationcenter.model.BusinessRecords; |
| | | import com.kidgrow.oprationcenter.service.IBusinessRecordsService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import com.kidgrow.oprationcenter.model.BusinessRecords; |
| | | import com.kidgrow.oprationcenter.service.IBusinessRecordsService; |
| | | import com.kidgrow.common.model.*; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * @Description: 业务操作记录 |
| | | * @Project: 用户中心 |
| | | * @CreateDate: Created in 2020-04-01 09:37:05 <br> |
| | | * @Project: 运营中心 |
| | | * @CreateDate: Created in 2020-04-02 18:25:34 <br> |
| | | * @Author: <a href="4345453@kidgrow.com">liuke</a> |
| | | * @version: 1.0 |
| | | */ |
| | |
| | | if (bindingResult.hasErrors()) { |
| | | return ResultBody.failed().msg(bindingResult.getFieldError().getDefaultMessage()); |
| | | } else { |
| | | businessRecordsService.saveOrUpdate(businessRecords); |
| | | return ResultBody.ok().data(businessRecords).msg("保存成功"); |
| | | boolean v= businessRecordsService.saveOrUpdate(businessRecords); |
| | | if(v) { |
| | | return ResultBody.ok().data(businessRecords).msg("保存成功"); |
| | | } |
| | | else { |
| | | return ResultBody.failed().msg("保存失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "删除") |
| | | @DeleteMapping("/{id}") |
| | | public ResultBody delete(@PathVariable Long id) { |
| | | businessRecordsService.removeById(id); |
| | | return ResultBody.ok().msg("删除成功"); |
| | | boolean v= businessRecordsService.removeById(id); |
| | | if(v) { |
| | | return ResultBody.ok().msg("删除成功"); |
| | | } |
| | | else { |
| | | return ResultBody.failed().msg("删除失败"); |
| | | } |
| | | } |
| | | } |