package com.srs.web.controller.dormitory;


import com.srs.common.core.controller.BaseController;
import com.srs.common.core.page.TableDataInfo;
import com.srs.dormitory.service.IDmsChangeLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 学生宿舍信息变化记录表 前端控制器
 * </p>
 *
 * @author szz
 * @since 2023年07月28日
 */
@Api(tags = "学生宿舍信息修改记录")
@RestController
@RequestMapping("/dormitory/dms-change-log")
public class DmsChangeLogController extends BaseController {
    @Autowired
    private IDmsChangeLogService dmsChangeLogService;

    @ApiOperation(value = "查看学生宿舍信息修改记录列表",notes =
            "请求示例:<br>"
                    + "{<br>"
                    + "&nbsp;&nbsp;&nbsp;&nbsp;\"classId\": 0, // 班级ID<br>"
                    + "&nbsp;&nbsp;&nbsp;&nbsp;\"name\": string, // 姓名关键字<br>"
                    + "&nbsp;&nbsp;&nbsp;&nbsp;\"type\": string, // 类型(入住、退宿、延迟退宿、假期留宿、换宿、外宿)<br>"
                    + "&nbsp;&nbsp;&nbsp;&nbsp;\"stuId\": 0, // 班级ID<br>"
                    + "}")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody Map<String,String> params){
        startPage();
        List<Map<String,Object>> list = dmsChangeLogService.getLogList(params);
        return getDataTable(list);
    }

}

