Files
RuoYi-Vue/ruoyi-app/src/main/java/com/ruoyi/app/controller/AppOpenController.java
王鹏 9122dabf88 init
2025-08-14 14:57:00 +08:00

57 lines
1.8 KiB
Java

package com.ruoyi.app.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.office.domain.TtArticles;
import com.ruoyi.office.service.ITtArticlesService;
import com.ruoyi.office.service.ITtProjectInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* app非权限信息接口
* qs
*/
@RestController
@RequestMapping("/app/open/article")
public class AppOpenController extends BaseController {
@Autowired
private ITtArticlesService ttArticlesService;
@Autowired
private ITtProjectInfoService ttProjectInfoService;
@GetMapping("/lastUpdate")
public AjaxResult lastUpdate() {
startPage();
return success(ttArticlesService.lastUpdateList(""));
}
@GetMapping("/page")
public AjaxResult page(String searchKey) {
startPage();
return success(getDataTable(ttArticlesService.lastUpdateList(searchKey)));
}
@GetMapping("/projectPage")
public AjaxResult projectPage(String searchKey) {
startPage();
return success(getDataTable(ttProjectInfoService.lastUpdateList(searchKey)));
}
@GetMapping("/detail")
public AjaxResult detail(Integer id) {
return success(ttArticlesService.selectTtArticlesById(id));
}
@GetMapping("/views")
public void views(Integer id) {
TtArticles ttArticles = ttArticlesService.selectTtArticlesById(id);
ttArticles.setViews(ttArticles.getViews() + 1);
ttArticlesService.updateTtArticles(ttArticles);
}
}