huwhois 5 anni fa
parent
commit
9f0f6f6c06

+ 90 - 0
src/main/java/io/renren/modules/admin/lecture/controller/LectureController.java

@ -0,0 +1,90 @@
1
package io.renren.modules.admin.lecture.controller;
2
3
import java.util.Arrays;
4
import java.util.Map;
5
6
import org.apache.shiro.authz.annotation.RequiresPermissions;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.web.bind.annotation.PathVariable;
9
import org.springframework.web.bind.annotation.RequestBody;
10
import org.springframework.web.bind.annotation.RequestMapping;
11
import org.springframework.web.bind.annotation.RequestParam;
12
import org.springframework.web.bind.annotation.RestController;
13
14
import io.renren.modules.admin.lecture.entity.LectureEntity;
15
import io.renren.modules.admin.lecture.service.LectureService;
16
import io.renren.common.utils.PageUtils;
17
import io.renren.common.utils.R;
18
19
20
21
/**
22
 * 演讲(报告)表
23
 *
24
 * @author chenshun
25
 * @email sunlightcs@gmail.com
26
 * @date 2020-02-11 14:36:45
27
 */
28
@RestController
29
@RequestMapping("admin/lecture")
30
public class LectureController {
31
    @Autowired
32
    private LectureService lectureService;
33
34
    /**
35
     * 列表
36
     */
37
    @RequestMapping("/list")
38
    @RequiresPermissions("generator:lecture:list")
39
    public R list(@RequestParam Map<String, Object> params){
40
        PageUtils page = lectureService.queryPage(params);
41
42
        return R.ok().put("page", page);
43
    }
44
45
46
    /**
47
     * 信息
48
     */
49
    @RequestMapping("/info/{id}")
50
    @RequiresPermissions("generator:lecture:info")
51
    public R info(@PathVariable("id") Long id){
52
		LectureEntity lecture = lectureService.getById(id);
53
54
        return R.ok().put("lecture", lecture);
55
    }
56
57
    /**
58
     * 保存
59
     */
60
    @RequestMapping("/save")
61
    @RequiresPermissions("generator:lecture:save")
62
    public R save(@RequestBody LectureEntity lecture){
63
		lectureService.save(lecture);
64
65
        return R.ok();
66
    }
67
68
    /**
69
     * 修改
70
     */
71
    @RequestMapping("/update")
72
    @RequiresPermissions("generator:lecture:update")
73
    public R update(@RequestBody LectureEntity lecture){
74
		lectureService.updateById(lecture);
75
76
        return R.ok();
77
    }
78
79
    /**
80
     * 删除
81
     */
82
    @RequestMapping("/delete")
83
    @RequiresPermissions("generator:lecture:delete")
84
    public R delete(@RequestBody Long[] ids){
85
		lectureService.removeByIds(Arrays.asList(ids));
86
87
        return R.ok();
88
    }
89
90
}

+ 17 - 0
src/main/java/io/renren/modules/admin/lecture/dao/LectureDao.java

@ -0,0 +1,17 @@
1
package io.renren.modules.admin.lecture.dao;
2
3
import io.renren.modules.generator.entity.LectureEntity;
4
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
5
import org.apache.ibatis.annotations.Mapper;
6
7
/**
8
 * 演讲(报告)表
9
 * 
10
 * @author chenshun
11
 * @email sunlightcs@gmail.com
12
 * @date 2020-02-11 14:36:45
13
 */
14
@Mapper
15
public interface LectureDao extends BaseMapper<LectureEntity> {
16
	
17
}

+ 60 - 0
src/main/java/io/renren/modules/admin/lecture/entity/LectureEntity.java

@ -0,0 +1,60 @@
1
package io.renren.modules.admin.lecture.entity;
2
3
import com.baomidou.mybatisplus.annotation.TableId;
4
import com.baomidou.mybatisplus.annotation.TableName;
5
6
import java.io.Serializable;
7
import java.util.Date;
8
import lombok.Data;
9
10
/**
11
 * 演讲(报告)表
12
 * 
13
 * @author chenshun
14
 * @email sunlightcs@gmail.com
15
 * @date 2020-02-11 14:36:45
16
 */
17
@Data
18
@TableName("lecture")
19
public class LectureEntity implements Serializable {
20
	private static final long serialVersionUID = 1L;
21
22
	/**
23
	 * 演讲id (演讲/报告表)
24
	 */
25
	@TableId
26
	private Long id;
27
	/**
28
	 * 会议id
29
	 */
30
	private Long meetingId;
31
	/**
32
	 * 演讲人id
33
	 */
34
	private Long speaker;
35
	/**
36
	 * 题目
37
	 */
38
	private String topic;
39
	/**
40
	 * 所属会场(主会场/分会场)
41
	 */
42
	private Integer branchId;
43
	/**
44
	 * 演讲时间
45
	 */
46
	private Integer speechTime;
47
	/**
48
	 * 摘要
49
	 */
50
	private String summary;
51
	/**
52
	 * 創建時間
53
	 */
54
	private Date createTime;
55
	/**
56
	 * 是否被删除 状态  0:正常   1:删除
57
	 */
58
	private Integer isDel;
59
60
}

+ 20 - 0
src/main/java/io/renren/modules/admin/lecture/service/LectureService.java

@ -0,0 +1,20 @@
1
package io.renren.modules.admin.lecture.service;
2
3
import com.baomidou.mybatisplus.extension.service.IService;
4
import io.renren.common.utils.PageUtils;
5
import io.renren.modules.admin.lecture.entity.LectureEntity;
6
7
import java.util.Map;
8
9
/**
10
 * 演讲(报告)表
11
 *
12
 * @author chenshun
13
 * @email sunlightcs@gmail.com
14
 * @date 2020-02-11 14:36:45
15
 */
16
public interface LectureService extends IService<LectureEntity> {
17
18
    PageUtils queryPage(Map<String, Object> params);
19
}
20

+ 29 - 0
src/main/java/io/renren/modules/admin/lecture/service/impl/LectureServiceImpl.java

@ -0,0 +1,29 @@
1
package io.renren.modules.admin.lecture.service.impl;
2
3
import org.springframework.stereotype.Service;
4
import java.util.Map;
5
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
6
import com.baomidou.mybatisplus.core.metadata.IPage;
7
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
8
import io.renren.common.utils.PageUtils;
9
import io.renren.common.utils.Query;
10
11
import io.renren.modules.admin.lecture.dao.LectureDao;
12
import io.renren.modules.admin.lecture.entity.LectureEntity;
13
import io.renren.modules.admin.lecture.service.LectureService;
14
15
16
@Service("lectureService")
17
public class LectureServiceImpl extends ServiceImpl<LectureDao, LectureEntity> implements LectureService {
18
19
    @Override
20
    public PageUtils queryPage(Map<String, Object> params) {
21
        IPage<LectureEntity> page = this.page(
22
                new Query<LectureEntity>().getPage(params),
23
                new QueryWrapper<LectureEntity>()
24
        );
25
26
        return new PageUtils(page);
27
    }
28
29
}