|
|
|
@ -3,7 +3,6 @@ package com.dsideal.resource.Base.Controller;
|
|
|
|
|
import com.dsideal.resource.Base.Model.BaseModel;
|
|
|
|
|
import com.dsideal.resource.Interceptor.EmptyInterface;
|
|
|
|
|
import com.dsideal.resource.Interceptor.IsNumericInterface;
|
|
|
|
|
import com.dsideal.resource.Interceptor.JwtCheckInterface;
|
|
|
|
|
import com.dsideal.resource.Util.RetKit;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.core.Controller;
|
|
|
|
@ -11,7 +10,6 @@ import com.jfinal.ext.interceptor.GET;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import io.github.yedaxia.apidocs.ApiDoc;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -22,7 +20,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* 获取学段列表
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
public void getStageList() {
|
|
|
|
|
List<Record> list = bm.getStageList();
|
|
|
|
|
Page<Record> page = new Page<>();
|
|
|
|
@ -42,7 +39,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@EmptyInterface({"subject_name", "subject_code"})
|
|
|
|
|
@IsNumericInterface({"sort_id", "stage_id"})
|
|
|
|
|
public void addSubject(String subject_name, String subject_code, int stage_id, int sort_id) {
|
|
|
|
@ -68,7 +64,6 @@ public class BaseController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsNumericInterface({"subject_id"})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
public void delSubject(int subject_id) {
|
|
|
|
|
bm.delSubject(subject_id);
|
|
|
|
|
renderJson(RetKit.renderSuccess("操作成功"));
|
|
|
|
@ -84,7 +79,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@EmptyInterface({"subject_name", "subject_code"})
|
|
|
|
|
@IsNumericInterface({"sort_id", "stage_id", "subject_id"})
|
|
|
|
|
public void updateSubject(int subject_id, String subject_name, String subject_code, int stage_id, int sort_id) {
|
|
|
|
@ -112,7 +106,6 @@ public class BaseController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsNumericInterface({"pageNum", "pageSize"})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
public void listSubject(int stage_id, int pageNum, int pageSize) {
|
|
|
|
|
Page<Record> listPage = bm.listSubject(stage_id, pageNum, pageSize);
|
|
|
|
|
renderJson(RetKit.renderSuccess(listPage));
|
|
|
|
@ -125,7 +118,6 @@ public class BaseController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@IsNumericInterface({"subject_id"})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
public void getSubject(int subject_id) {
|
|
|
|
|
Record record = bm.getSubject(subject_id);
|
|
|
|
|
renderJson(RetKit.renderSuccess(record));
|
|
|
|
@ -143,7 +135,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@EmptyInterface({"scheme_name"})
|
|
|
|
|
@IsNumericInterface({"stage_id", "subject_id", "type_id", "sort_id", "owner_id"})
|
|
|
|
|
public void addScheme(String scheme_name, int stage_id, int subject_id, int owner_id, int type_id, int sort_id) {
|
|
|
|
@ -164,7 +155,6 @@ public class BaseController extends Controller {
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@IsNumericInterface({"scheme_id"})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
public void delScheme(int scheme_id) {
|
|
|
|
|
bm.delScheme(scheme_id);
|
|
|
|
|
renderJson(RetKit.renderSuccess("操作成功"));
|
|
|
|
@ -202,7 +192,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param pageSize 每页大小
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@IsNumericInterface({"pageNum", "pageSize"})
|
|
|
|
|
public void listScheme(int stage_id, int subject_id, int pageNum, int pageSize) {
|
|
|
|
|
Page<Record> listPage = bm.listScheme(stage_id, subject_id, pageNum, pageSize);
|
|
|
|
@ -215,7 +204,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param scheme_id 版本ID
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@IsNumericInterface({"scheme_id"})
|
|
|
|
|
public void getScheme(int scheme_id) {
|
|
|
|
|
Record record = bm.getScheme(scheme_id);
|
|
|
|
@ -231,7 +219,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
public void addResourceStructure(String structure_name, int parent_id, int scheme_id, int sort_id) {
|
|
|
|
|
bm.addResourceStructure(structure_name, parent_id, scheme_id, sort_id);
|
|
|
|
|
renderJson(RetKit.renderSuccess("操作成功"));
|
|
|
|
@ -243,7 +230,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param structure_id 主键
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@IsNumericInterface({"structure_id"})
|
|
|
|
|
public void delResourceStructureById(int structure_id) {
|
|
|
|
|
bm.delResourceStructureById(structure_id);
|
|
|
|
@ -260,7 +246,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param sort_id 排序号
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@IsNumericInterface({"structure_id"})
|
|
|
|
|
public void updateResourceStructureById(int structure_id, String structure_name, int parent_id, int scheme_id, int sort_id) {
|
|
|
|
|
bm.updateResourceStructureById(structure_id, structure_name, parent_id, scheme_id, sort_id);
|
|
|
|
@ -273,7 +258,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param structure_id 主键
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
@IsNumericInterface({"structure_id"})
|
|
|
|
|
public void getResourceStructureById(int structure_id) {
|
|
|
|
|
renderJson(RetKit.renderSuccess(bm.getResourceStructureById(structure_id)));
|
|
|
|
@ -285,7 +269,6 @@ public class BaseController extends Controller {
|
|
|
|
|
* @param scheme_id 版本ID
|
|
|
|
|
*/
|
|
|
|
|
@Before({GET.class})
|
|
|
|
|
@JwtCheckInterface({})
|
|
|
|
|
public void fetchStructure(int scheme_id) {
|
|
|
|
|
List<Record> list = bm.fetchStructure(scheme_id, -1);
|
|
|
|
|
renderJson(RetKit.renderSuccess("成功", list));
|
|
|
|
|