You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
870 B
35 lines
870 B
package web.controller;
|
|
|
|
import core.util.DBAction;
|
|
import db.model.DataModel;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import web.service.DataService;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.EnumSet;
|
|
|
|
@Controller
|
|
@RequestMapping("/data")
|
|
public class DataController extends BaseController<DataModel> {
|
|
|
|
@Resource
|
|
private DataService dataService;
|
|
|
|
@RequestMapping("start/{size}")
|
|
public void start(@PathVariable Integer size){
|
|
stop();
|
|
dataService.start(size);
|
|
}
|
|
|
|
@RequestMapping("stop")
|
|
public void stop(){
|
|
dataService.stop();
|
|
}
|
|
|
|
@Override
|
|
public boolean checkAction(DBAction action) {
|
|
return !EnumSet.of(DBAction.D,DBAction.BD).contains(action);
|
|
}
|
|
}
|
|
|