2024.5.15 纪念馆新后台
This commit is contained in:
parent
bdc336f8f9
commit
10b079283c
|
@ -84,7 +84,7 @@ public class CommonController
|
|||
String url = serverConfig.getUrl() + fileName;
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
ajax.put("url", url);
|
||||
ajax.put("fileName", fileName);
|
||||
ajax.put("fileName", url);
|
||||
ajax.put("newFileName", FileUtils.getName(fileName));
|
||||
ajax.put("originalFilename", file.getOriginalFilename());
|
||||
return ajax;
|
||||
|
|
|
@ -33,8 +33,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/article")
|
||||
public class CmsArticleController extends BaseController
|
||||
{
|
||||
public class CmsArticleController extends BaseController {
|
||||
@Autowired
|
||||
private ICmsArticleService cmsArticleService;
|
||||
|
||||
|
@ -46,8 +45,7 @@ public class CmsArticleController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:article:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CmsArticle cmsArticle)
|
||||
{
|
||||
public TableDataInfo list(CmsArticle cmsArticle) {
|
||||
startPage();
|
||||
List<CmsArticle> list = cmsArticleService.selectCmsArticleList(cmsArticle);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
@ -67,8 +65,7 @@ public class CmsArticleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:article:export')")
|
||||
@Log(title = "文章管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CmsArticle cmsArticle)
|
||||
{
|
||||
public void export(HttpServletResponse response, CmsArticle cmsArticle) {
|
||||
List<CmsArticle> list = cmsArticleService.selectCmsArticleList(cmsArticle);
|
||||
ExcelUtil<CmsArticle> util = new ExcelUtil<CmsArticle>(CmsArticle.class);
|
||||
util.exportExcel(response, list, "文章管理数据");
|
||||
|
@ -79,8 +76,7 @@ public class CmsArticleController extends BaseController
|
|||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:article:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return success(cmsArticleService.selectCmsArticleById(id));
|
||||
}
|
||||
|
||||
|
@ -90,9 +86,14 @@ public class CmsArticleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:article:add')")
|
||||
@Log(title = "文章管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CmsArticle cmsArticle)
|
||||
{
|
||||
public AjaxResult add(@RequestBody CmsArticle cmsArticle) {
|
||||
String content = new String(Base64.decode(cmsArticle.getContent()));
|
||||
if (content.contains("/dev-api")) {
|
||||
content = content.replace("/dev-api", "");
|
||||
}
|
||||
if (content.contains("/prod-api")) {
|
||||
content = content.replace("/prod-api", "");
|
||||
}
|
||||
cmsArticle.setContent(content);
|
||||
return toAjax(cmsArticleService.insertCmsArticle(cmsArticle));
|
||||
}
|
||||
|
@ -103,9 +104,14 @@ public class CmsArticleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:article:edit')")
|
||||
@Log(title = "文章管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CmsArticle cmsArticle)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody CmsArticle cmsArticle) {
|
||||
String content = new String(Base64.decode(cmsArticle.getContent()));
|
||||
if (content.contains("/dev-api")) {
|
||||
content = content.replace("/dev-api", "");
|
||||
}
|
||||
if (content.contains("/prod-api")) {
|
||||
content = content.replace("/prod-api", "");
|
||||
}
|
||||
cmsArticle.setContent(content);
|
||||
return toAjax(cmsArticleService.updateCmsArticle(cmsArticle));
|
||||
}
|
||||
|
@ -116,8 +122,7 @@ public class CmsArticleController extends BaseController
|
|||
@PreAuthorize("@ss.hasPermi('system:article:remove')")
|
||||
@Log(title = "文章管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(cmsArticleService.deleteCmsArticleByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue