| | |
| | | import com.baomidou.mybatisplus.extension.api.R;
|
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
| | | import com.ycl.entity.NewsPolice;
|
| | | import com.ycl.service.NewsAdminService;
|
| | | import com.ycl.service.NewsPoliceService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import java.io.Serializable;
|
| | | import java.sql.SQLException;
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | @Resource
|
| | | private NewsPoliceService newsPoliceService;
|
| | |
|
| | | @Autowired
|
| | | private NewsAdminService newsAdminService;
|
| | |
|
| | | /**
|
| | | * 分页查询所有数据
|
| | |
| | | * @param newsPolice 实体对象
|
| | | * @return 新增结果
|
| | | */
|
| | | @Transactional(rollbackFor = SQLException.class)
|
| | | @PostMapping
|
| | | public R insert(@RequestBody NewsPolice newsPolice) {
|
| | | return success(this.newsPoliceService.save(newsPolice));
|
| | | this.newsPoliceService.save(newsPolice);
|
| | | return success(newsAdminService.autoCreateAdmin(newsPolice));
|
| | | }
|
| | |
|
| | | /**
|