Some more work done on the feature object

This commit is contained in:
Merel Steenbergen
2019-03-14 15:08:49 +01:00
parent 249b40572e
commit 922f8b2657
4 changed files with 58 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
package greenify.client.rest;
import greenify.common.ActivityDTO;
import greenify.common.ApplicationException;
import greenify.common.UserDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
public class ActivityService {
Logger logger = LoggerFactory.getLogger(greenify.server.service.ActivityService.class);
@Autowired
UserRepository userRepository;
/**
* Adds the activity to the history of the user and adds the score.
* @param name the name of the activity
* @return a activityDTO of activity.
*/
public ActivityDTO addActivity(String name) {
}
}

View File

@@ -12,7 +12,7 @@ public class ActivityDTO {
public ActivityDTO(Long id, String name, String description, int score) {
this.id = id;
this.name = name;
this.description=description;
this.description = description;
this.score= score;
}

View File

@@ -0,0 +1,26 @@
package greenify.server.rest;
import greenify.common.UserDTO;
import greenify.server.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ActivityController {
@Autowired
UserService userService;
@RequestMapping("/addActivity")
public UserDTO registerUser(@RequestParam(value = "name") String name,
@RequestParam(value = "password") String password) {
return userService.registerUser(name, password);
}
@RequestMapping("/login")
public UserDTO login(@RequestParam(value = "name") String name,
@RequestParam(value = "password") String password) {
return userService.login(name, password);
}
}

View File

@@ -0,0 +1,6 @@
package greenify.server.service;
public class ActivityService {
}