教师我的课程位置移动
parent
08d160e113
commit
82c8dee119
@ -0,0 +1,34 @@
|
||||
package com.ibeetl.jlw.enums;
|
||||
|
||||
import cn.jlw.util.EnumUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.beetl.sql.annotation.entity.EnumMapping;
|
||||
|
||||
/**
|
||||
* 排序移动类型
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@EnumMapping("text")
|
||||
public enum MoveEnum {
|
||||
// 进行中
|
||||
MOVE_TOP(10, "置顶"),
|
||||
// 已结束
|
||||
MOVE_LEFT(20, "前移"),
|
||||
// 未开始
|
||||
MOVE_RIGHT(30, "后移");
|
||||
|
||||
private Integer code;
|
||||
|
||||
// 可以转换成中文
|
||||
// @JsonValue
|
||||
|
||||
private String text;
|
||||
|
||||
|
||||
public static MoveEnum getByCode(Integer code) {
|
||||
return EnumUtil.getByFieldWithValue(MoveEnum.class, "code", code);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.ibeetl.jlw.web;
|
||||
|
||||
import base.BaseTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.test.web.servlet.RequestBuilder;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author mlx
|
||||
* @date 2022/10/24
|
||||
* @modified
|
||||
*/
|
||||
class TeacherOpenCourseMergeTeacherControllerTest extends BaseTest {
|
||||
|
||||
private static final String MODEL = "/jlw/teacherOpenCourseMergeTeacher";
|
||||
private static final String API = "/api/teacherOpenCourseMergeTeacher";
|
||||
|
||||
@Test
|
||||
void move() throws Exception {
|
||||
//构造请求参数
|
||||
RequestBuilder rb = MockMvcRequestBuilders.post(MODEL + "/move.json")
|
||||
.param("teacherOpenCourseId", "1569699103338831872")
|
||||
.param("moveType", "MOVE_TOP");
|
||||
|
||||
// 测试账号,佟老师
|
||||
putLoginInfoToEnv("102", "26");
|
||||
|
||||
//发送请求,验证返回结果
|
||||
String result = mvc.perform(rb)
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(MockMvcResultMatchers.jsonPath("$.code").value("0"))
|
||||
.andReturn().getResponse().getContentAsString(Charset.defaultCharset());
|
||||
|
||||
System.out.println(result);
|
||||
clearEnvLoginInfo();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue