library upgrades

This commit is contained in:
Jörg Henke
2024-06-11 21:25:48 +02:00
parent c4615765a5
commit c757bb5916
12 changed files with 53 additions and 71 deletions

View File

@ -1,5 +1,5 @@
plugins { plugins {
id 'org.springframework.boot' version '3.1.3' id 'org.springframework.boot' version '3.3.0'
id 'java' id 'java'
id 'war' id 'war'
} }
@ -7,7 +7,7 @@ plugins {
apply plugin: 'io.spring.dependency-management' apply plugin: 'io.spring.dependency-management'
group = 'de.jottyfan' group = 'de.jottyfan'
version = '1.5.1' version = '1.5.2'
description = """timetrack""" description = """timetrack"""
@ -25,9 +25,9 @@ repositories {
dependencies { dependencies {
implementation 'de.jottyfan:timetrackjooq:20240109' implementation 'de.jottyfan:timetrackjooq:20240109'
implementation 'org.apache.logging.log4j:log4j-api:latest.release' implementation 'org.apache.logging.log4j:log4j-api:2.23.1'
implementation 'org.apache.logging.log4j:log4j-core:latest.release' implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
implementation 'org.apache.logging.log4j:log4j-to-slf4j:latest.release' implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.23.1'
implementation 'org.webjars:bootstrap:5.3.2' implementation 'org.webjars:bootstrap:5.3.2'
implementation 'org.webjars:font-awesome:6.4.2' implementation 'org.webjars:font-awesome:6.4.2'
@ -67,9 +67,9 @@ war {
"Implementation-Timestamp": new Date()) "Implementation-Timestamp": new Date())
} }
} }
baseName = project.name archiveBaseName = project.name
version = version archiveVersion = version
archiveName = 'timetrack.war' archiveFileName = 'timetrack.war'
} }
test { test {

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -39,8 +39,9 @@ public class InitialConfiguration {
} }
@Bean @Bean
public void disableLogo() { public Boolean disableLogo() {
System.setProperty("org.jooq.no-logo", "true"); System.setProperty("org.jooq.no-logo", "true");
return true;
} }
public DefaultConfiguration configuration() { public DefaultConfiguration configuration() {

View File

@ -45,7 +45,7 @@ public class IndexController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/") @GetMapping("/")
public String getIndex(@ModelAttribute DoneModel doneModel, Model model, OAuth2AuthenticationToken token) { public String getIndex(@ModelAttribute("doneModel") DoneModel doneModel, Model model, OAuth2AuthenticationToken token) {
String username = provider.getName(); String username = provider.getName();
Duration maxWorkTime = Duration.ofHours(8); // TODO: to the configuration file Duration maxWorkTime = Duration.ofHours(8); // TODO: to the configuration file
LocalDate day = LocalDate.now(); LocalDate day = LocalDate.now();

View File

@ -61,14 +61,13 @@ public class CalendarDoneRepository {
String billing = r.get(T_BILLING.NAME); String billing = r.get(T_BILLING.NAME);
LocalDateTime start = r.get(T_DONE.TIME_FROM); LocalDateTime start = r.get(T_DONE.TIME_FROM);
LocalDateTime end = r.get(T_DONE.TIME_UNTIL); LocalDateTime end = r.get(T_DONE.TIME_UNTIL);
StringBuilder buf = new StringBuilder(); String title = String.format("%s %s %s %s", blankIfNull(billing, "; "), blankIfNull(project, " - "), blankIfNull(module, ": "), blankIfNull(job, "")).trim();
buf.append(billing).append(billing == null ? "" : "; ");
buf.append(job).append(job == null ? "" : " - ");
buf.append(module).append(module == null ? "" : ": ");
buf.append(project);
String title = buf.toString();
list.add(EventBean.ofEvent(id, title, start, end)); list.add(EventBean.ofEvent(id, title, start, end));
} }
return list; return list;
} }
private final String blankIfNull(String s, String appendix) {
return s == null ? "" : s.concat(appendix);
}
} }

View File

@ -50,7 +50,7 @@ public class ContactController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/contact/edit/{id}") @GetMapping("/contact/edit/{id}")
public String toItem(@PathVariable Integer id, Model model) { public String toItem(@PathVariable("id") Integer id, Model model) {
ContactBean bean = contactService.getBean(id); ContactBean bean = contactService.getBean(id);
if (bean == null) { if (bean == null) {
bean = new ContactBean(); // the add case bean = new ContactBean(); // the add case
@ -62,14 +62,14 @@ public class ContactController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@PostMapping("/contact/upsert") @PostMapping("/contact/upsert")
public String doUpsert(Model model, @ModelAttribute ContactBean bean) { public String doUpsert(Model model, @ModelAttribute("bean") ContactBean bean) {
Integer amount = contactService.doUpsert(bean); Integer amount = contactService.doUpsert(bean);
return amount.equals(1) ? getList(model) : toItem(bean.getPk(), model); return amount.equals(1) ? getList(model) : toItem(bean.getPk(), model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/contact/delete/{id}") @GetMapping(value = "/contact/delete/{id}")
public String doDelete(@PathVariable Integer id, Model model) { public String doDelete(@PathVariable("id") Integer id, Model model) {
Integer amount = contactService.doDelete(id); Integer amount = contactService.doDelete(id);
return amount.equals(1) ? getList(model) : toItem(id, model); return amount.equals(1) ? getList(model) : toItem(id, model);
} }

View File

@ -84,13 +84,13 @@ public class DoneController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/abort/{day}") @GetMapping("/done/abort/{day}")
public String abort(@PathVariable String day, Model model) { public String abort(@PathVariable("day") String day, Model model) {
return "redirect:/done/list"; return "redirect:/done/list";
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/add/{day}") @GetMapping("/done/add/{day}")
public String toAdd(@PathVariable @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate day, Model model) { public String toAdd(@PathVariable("day") @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate day, Model model) {
DoneBean bean = new DoneBean(); DoneBean bean = new DoneBean();
bean.setLocalDate(day); bean.setLocalDate(day);
return toItem(bean, model); return toItem(bean, model);
@ -107,7 +107,7 @@ public class DoneController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/edit/{id}") @GetMapping("/done/edit/{id}")
public String toItem(@PathVariable Integer id, Model model) { public String toItem(@PathVariable("id") Integer id, Model model) {
DoneBean bean = doneService.getBean(id); DoneBean bean = doneService.getBean(id);
if (bean == null) { if (bean == null) {
bean = new DoneBean(); // the add case; typically, only add from today bean = new DoneBean(); // the add case; typically, only add from today
@ -117,7 +117,7 @@ public class DoneController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/end/{id}") @GetMapping("/done/end/{id}")
public String end(@PathVariable Integer id, Model model) { public String end(@PathVariable("id") Integer id, Model model) {
DoneBean bean = doneService.getBean(id); DoneBean bean = doneService.getBean(id);
String username = provider.getName(); String username = provider.getName();
doneService.endToNow(bean, username); doneService.endToNow(bean, username);
@ -126,7 +126,7 @@ public class DoneController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/copy/{id}") @GetMapping("/done/copy/{id}")
public String copyFromNow(@PathVariable Integer id, Model model) { public String copyFromNow(@PathVariable("id") Integer id, Model model) {
DoneBean bean = doneService.getBean(id); DoneBean bean = doneService.getBean(id);
String username = provider.getName(); String username = provider.getName();
doneService.copyFromNow(bean, username); doneService.copyFromNow(bean, username);
@ -135,7 +135,7 @@ public class DoneController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@PostMapping("/done/upsert") @PostMapping("/done/upsert")
public String doUpsert(Model model, @ModelAttribute DoneBean bean) { public String doUpsert(Model model, @ModelAttribute("bean") DoneBean bean) {
String username = provider.getName(); String username = provider.getName();
Integer amount = doneService.doUpsert(bean, username); Integer amount = doneService.doUpsert(bean, username);
return amount.equals(1) ? "redirect:/done/list" : "redirect:/" + toItem(bean.getPk(), model); return amount.equals(1) ? "redirect:/done/list" : "redirect:/" + toItem(bean.getPk(), model);
@ -143,7 +143,7 @@ public class DoneController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/addrecent/{id}") @GetMapping("/done/addrecent/{id}")
public String addRecent(Model model, @PathVariable Integer id) { public String addRecent(Model model, @PathVariable("id") Integer id) {
String username = provider.getName(); String username = provider.getName();
DoneBean bean = doneService.getBean(id); DoneBean bean = doneService.getBean(id);
doneService.addRecent(bean, username); doneService.addRecent(bean, username);
@ -168,28 +168,28 @@ public class DoneController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/done/delete/{id}") @GetMapping(value = "/done/delete/{id}")
public String doDelete(@PathVariable Integer id, Model model) { public String doDelete(@PathVariable("id") Integer id, Model model) {
Integer amount = doneService.doDelete(id); Integer amount = doneService.doDelete(id);
return amount.equals(1) ? "redirect:/done/list" : "redirect:/" + toItem(id, model); return amount.equals(1) ? "redirect:/done/list" : "redirect:/" + toItem(id, model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/done/favorize/{id}") @GetMapping(value = "/done/favorize/{id}")
public String favorize(@PathVariable Integer id) { public String favorize(@PathVariable("id") Integer id) {
doneService.favorize(id); doneService.favorize(id);
return "redirect:/done/list"; return "redirect:/done/list";
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/done/unfavorize/{id}") @GetMapping(value = "/done/unfavorize/{id}")
public String unfavorize(@PathVariable Integer id) { public String unfavorize(@PathVariable("id") Integer id) {
doneService.unfavorize(id); doneService.unfavorize(id);
return "redirect:/done/list"; return "redirect:/done/list";
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/done/usefav/{id}") @GetMapping(value = "/done/usefav/{id}")
public String usefavorite(@PathVariable Integer id) { public String usefavorite(@PathVariable("id") Integer id) {
doneService.usefavorite(id); doneService.usefavorite(id);
return "redirect:/done/list"; return "redirect:/done/list";
} }

View File

@ -6,14 +6,11 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import de.jottyfan.timetrack.component.OAuth2Provider; import de.jottyfan.timetrack.component.OAuth2Provider;
import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; import de.jottyfan.timetrack.db.done.tables.records.TJobRecord;
import de.jottyfan.timetrack.modules.CommonController; import de.jottyfan.timetrack.modules.CommonController;
import de.jottyfan.timetrack.modules.done.DoneController;
import de.jottyfan.timetrack.modules.done.model.DoneModel;
import de.jottyfan.timetrack.modules.profile.ProfileService; import de.jottyfan.timetrack.modules.profile.ProfileService;
import jakarta.annotation.security.RolesAllowed; import jakarta.annotation.security.RolesAllowed;
@ -27,9 +24,6 @@ public class JobController extends CommonController {
@Autowired @Autowired
private JobService jobService; private JobService jobService;
@Autowired
private DoneController doneController;
@Autowired @Autowired
private OAuth2Provider provider; private OAuth2Provider provider;
@ -38,7 +32,7 @@ public class JobController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/edit/job/{id}") @GetMapping("/done/edit/job/{id}")
public String toJob(@PathVariable Integer id, Model model) { public String toJob(@PathVariable("id") Integer id, Model model) {
String username = provider.getName(); String username = provider.getName();
TJobRecord job = jobService.get(id); TJobRecord job = jobService.get(id);
model.addAttribute("jobBean", job); model.addAttribute("jobBean", job);
@ -47,21 +41,21 @@ public class JobController extends CommonController {
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@RequestMapping(value = "/done/upsert/job", method = RequestMethod.POST) @PostMapping("/done/upsert/job")
public String doUpsert(Model model, @ModelAttribute TJobRecord bean) { public String doUpsert(Model model, @ModelAttribute("bean") TJobRecord bean) {
Integer amount = jobService.doUpsert(bean); Integer amount = jobService.doUpsert(bean);
return amount.equals(1) ? "redirect:/done/list": toJob(bean.getPk(), model); return amount.equals(1) ? "redirect:/done/list": toJob(bean.getPk(), model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@RequestMapping(value = "/done/add/job", method = RequestMethod.GET) @GetMapping("/done/add/job")
public String toAddJob(Model model) { public String toAddJob(Model model) {
return toJob(null, model); return toJob(null, model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/done/delete/job/{id}") @GetMapping(value = "/done/delete/job/{id}")
public String doDeleteJob(@PathVariable Integer id, Model model) { public String doDeleteJob(@PathVariable("id") Integer id, Model model) {
Integer amount = jobService.doDelete(id); Integer amount = jobService.doDelete(id);
return amount.equals(1) ? "redirect:/done/list" : toJob(id, model); return amount.equals(1) ? "redirect:/done/list" : toJob(id, model);
} }

View File

@ -6,14 +6,11 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import de.jottyfan.timetrack.component.OAuth2Provider; import de.jottyfan.timetrack.component.OAuth2Provider;
import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord;
import de.jottyfan.timetrack.modules.CommonController; import de.jottyfan.timetrack.modules.CommonController;
import de.jottyfan.timetrack.modules.done.DoneController;
import de.jottyfan.timetrack.modules.done.model.DoneModel;
import de.jottyfan.timetrack.modules.profile.ProfileService; import de.jottyfan.timetrack.modules.profile.ProfileService;
import jakarta.annotation.security.RolesAllowed; import jakarta.annotation.security.RolesAllowed;
@ -28,9 +25,6 @@ public class ModuleController extends CommonController {
@Autowired @Autowired
private ModuleService moduleService; private ModuleService moduleService;
@Autowired
private DoneController doneController;
@Autowired @Autowired
private OAuth2Provider provider; private OAuth2Provider provider;
@ -39,7 +33,7 @@ public class ModuleController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/edit/module/{id}") @GetMapping("/done/edit/module/{id}")
public String toModule(@PathVariable Integer id, Model model) { public String toModule(@PathVariable("id") Integer id, Model model) {
String username = provider.getName(); String username = provider.getName();
TModuleRecord module = moduleService.get(id); TModuleRecord module = moduleService.get(id);
model.addAttribute("moduleBean", module); model.addAttribute("moduleBean", module);
@ -48,21 +42,21 @@ public class ModuleController extends CommonController {
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@RequestMapping(value = "/done/upsert/module", method = RequestMethod.POST) @PostMapping("/done/upsert/module")
public String doUpsert(Model model, @ModelAttribute TModuleRecord bean) { public String doUpsert(Model model, @ModelAttribute("bean") TModuleRecord bean) {
Integer amount = moduleService.doUpsert(bean); Integer amount = moduleService.doUpsert(bean);
return amount.equals(1) ? "redirect:/done/list" : toModule(bean.getPk(), model); return amount.equals(1) ? "redirect:/done/list" : toModule(bean.getPk(), model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@RequestMapping(value = "/done/add/module", method = RequestMethod.GET) @GetMapping("/done/add/module")
public String toAddModule(Model model) { public String toAddModule(Model model) {
return toModule(null, model); return toModule(null, model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/done/delete/module/{id}") @GetMapping(value = "/done/delete/module/{id}")
public String doDeleteModule(@PathVariable Integer id, Model model) { public String doDeleteModule(@PathVariable("id") Integer id, Model model) {
Integer amount = moduleService.doDelete(id); Integer amount = moduleService.doDelete(id);
return amount.equals(1) ? "redirect:/done/list" : toModule(id, model); return amount.equals(1) ? "redirect:/done/list" : toModule(id, model);
} }

View File

@ -6,14 +6,11 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import de.jottyfan.timetrack.component.OAuth2Provider; import de.jottyfan.timetrack.component.OAuth2Provider;
import de.jottyfan.timetrack.db.done.tables.records.TProjectRecord; import de.jottyfan.timetrack.db.done.tables.records.TProjectRecord;
import de.jottyfan.timetrack.modules.CommonController; import de.jottyfan.timetrack.modules.CommonController;
import de.jottyfan.timetrack.modules.done.DoneController;
import de.jottyfan.timetrack.modules.done.model.DoneModel;
import de.jottyfan.timetrack.modules.profile.ProfileService; import de.jottyfan.timetrack.modules.profile.ProfileService;
import jakarta.annotation.security.RolesAllowed; import jakarta.annotation.security.RolesAllowed;
@ -27,9 +24,6 @@ public class ProjectController extends CommonController {
@Autowired @Autowired
private ProjectService projectService; private ProjectService projectService;
@Autowired
private DoneController doneController;
@Autowired @Autowired
private OAuth2Provider provider; private OAuth2Provider provider;
@ -38,7 +32,7 @@ public class ProjectController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/done/edit/project/{id}") @GetMapping("/done/edit/project/{id}")
public String toProject(@PathVariable Integer id, Model model) { public String toProject(@PathVariable("id") Integer id, Model model) {
String username = provider.getName(); String username = provider.getName();
TProjectRecord project = projectService.get(id); TProjectRecord project = projectService.get(id);
model.addAttribute("projectBean", project); model.addAttribute("projectBean", project);
@ -47,21 +41,21 @@ public class ProjectController extends CommonController {
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@RequestMapping(value = "/done/upsert/project", method = RequestMethod.POST) @PostMapping("/done/upsert/project")
public String doUpsert(Model model, @ModelAttribute TProjectRecord bean) { public String doUpsert(Model model, @ModelAttribute("bean") TProjectRecord bean) {
Integer amount = projectService.doUpsert(bean); Integer amount = projectService.doUpsert(bean);
return amount.equals(1) ? "redirect:/done/list" : toProject(bean.getPk(), model); return amount.equals(1) ? "redirect:/done/list" : toProject(bean.getPk(), model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@RequestMapping(value = "/done/add/project", method = RequestMethod.GET) @GetMapping("/done/add/project")
public String toAddProject(Model model) { public String toAddProject(Model model) {
return toProject(null, model); return toProject(null, model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/done/delete/project/{id}") @GetMapping(value = "/done/delete/project/{id}")
public String doDeleteProject(@PathVariable Integer id, Model model) { public String doDeleteProject(@PathVariable("id") Integer id, Model model) {
Integer amount = projectService.doDelete(id); Integer amount = projectService.doDelete(id);
return amount.equals(1) ? "redirect:/done/list" : toProject(id, model); return amount.equals(1) ? "redirect:/done/list" : toProject(id, model);
} }

View File

@ -44,7 +44,7 @@ public class NoteController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping("/note/edit/{id}") @GetMapping("/note/edit/{id}")
public String toItem(@PathVariable Integer id, Model model) { public String toItem(@PathVariable("id") Integer id, Model model) {
NoteBean bean = noteService.getBean(id); NoteBean bean = noteService.getBean(id);
if (bean == null) { if (bean == null) {
bean = new NoteBean(); // the add case bean = new NoteBean(); // the add case
@ -57,14 +57,14 @@ public class NoteController extends CommonController {
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@PostMapping("/note/upsert") @PostMapping("/note/upsert")
public String doUpsert(Model model, @ModelAttribute NoteBean bean, OAuth2AuthenticationToken token) { public String doUpsert(Model model, @ModelAttribute("bean") NoteBean bean, OAuth2AuthenticationToken token) {
Integer amount = noteService.doUpsert(bean); Integer amount = noteService.doUpsert(bean);
return amount.equals(1) ? getList(model) : toItem(bean.getPk(), model); return amount.equals(1) ? getList(model) : toItem(bean.getPk(), model);
} }
@RolesAllowed("timetrack_user") @RolesAllowed("timetrack_user")
@GetMapping(value = "/note/delete/{id}") @GetMapping(value = "/note/delete/{id}")
public String doDelete(@PathVariable Integer id, Model model, OAuth2AuthenticationToken token) { public String doDelete(@PathVariable("id") Integer id, Model model, OAuth2AuthenticationToken token) {
Integer amount = noteService.doDelete(id); Integer amount = noteService.doDelete(id);
return amount.equals(1) ? getList(model) : toItem(id, model); return amount.equals(1) ? getList(model) : toItem(id, model);
} }

View File

@ -22,7 +22,7 @@ public class ProfileController extends CommonController {
private ProfileService service; private ProfileService service;
@PostMapping("/profile/{theme}") @PostMapping("/profile/{theme}")
public String setTheme(@PathVariable String theme) { public String setTheme(@PathVariable("theme") String theme) {
String username = provider.getName(); String username = provider.getName();
service.setTheme(username, theme); service.setTheme(username, theme);
return "redirect:/"; return "redirect:/";