package com.mortals.xhx.module.demo.web;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonMappingController;
import com.mortals.xhx.module.demo.model.DemoEntity;
import com.mortals.xhx.module.demo.service.DemoService;
import java.util.Map;
import java.util.List;
/**
* DemoController
*
* 测试demo 控制器
*
* @author zxfei
* @date 2021-10-22
*/
@RestController
@RequestMapping("demo")
public class DemoController extends BaseCRUDJsonMappingController<DemoService,DemoForm,DemoEntity,String> {

    @Autowired
    private ParamService paramService;

    public DemoController(){
        super.setFormClass(DemoForm.class);
        super.setModuleDesc( "测试demo");
    }

    @Override
    protected void init(HttpServletRequest request, HttpServletResponse response, DemoForm form, Map<String, Object> model, Context context) {
        this.addDict(model, "fieldThree", paramService.getParamByFirstOrganize("fieldThree"));
        super.init(request, response, form, model, context);
    }

}