| | |
| | | |
| | | import com.ycl.jxkg.base.BaseApiController; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.domain.Subject; |
| | | import com.ycl.jxkg.domain.entity.Subject; |
| | | import com.ycl.jxkg.service.SubjectService; |
| | | import com.ycl.jxkg.utils.PageInfoHelper; |
| | | import com.ycl.jxkg.vo.admin.education.SubjectEditRequestVO; |
| | | import com.ycl.jxkg.vo.admin.education.SubjectPageRequestVO; |
| | | import com.ycl.jxkg.vo.admin.education.SubjectResponseVO; |
| | | import com.ycl.jxkg.domain.vo.admin.education.SubjectEditRequestVO; |
| | | import com.ycl.jxkg.domain.vo.admin.education.SubjectPageRequestVO; |
| | | import com.ycl.jxkg.domain.vo.admin.education.SubjectResponseVO; |
| | | import com.github.pagehelper.PageInfo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | Subject subject = new Subject(); |
| | | BeanUtils.copyProperties(model, subject); |
| | | if (model.getId() == null) { |
| | | subject.setDeleted(false); |
| | | subjectService.save(subject); |
| | | } else { |
| | | subjectService.updateById(subject); |
| | |
| | | @RequestMapping(value = "/subject/delete/{id}", method = RequestMethod.POST) |
| | | public Result delete(@PathVariable Integer id) { |
| | | Subject subject = subjectService.getById(id); |
| | | subject.setDeleted(true); |
| | | subjectService.updateById(subject); |
| | | return Result.ok(); |
| | | } |