Examples of SkillDTO


Examples of cz.muni.fi.pa165.ddtroops.dto.SkillDTO

        String path = request.getPathInfo();

        if (RestHelpers.isRoot(path)) {
            try {
                SkillDTO s = mapper.readValue(request.getInputStream(), SkillDTO.class);
                service.create(s);
                response.setHeader("Location", path);
            } catch (IllegalArgumentException | NullPointerException e) {
                RestHelpers.printErrorMessage(response);
            }
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.dto.SkillDTO

        request.setCharacterEncoding("utf-8");
        String path = request.getPathInfo();
        if (RestHelpers.isNonnegative(RestHelpers.getFirst(path))) {
            try {
                SkillDTO s = mapper.readValue(request.getInputStream(), SkillDTO.class);
               
                s.id = (long) Integer.parseInt(RestHelpers.getFirst(path));
               
                service.update(s);
            } catch (IllegalArgumentException | NullPointerException e) {
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.dto.SkillDTO

                                createSkill.getDescription(),
                                createSkill.getProfession(),
                                createSkill.getMinXP()));
                    break;
                case "updateskill":
                    SkillDTO s = ss.createNewSkill(
                                updateSkill.getName(),
                                updateSkill.getDescription(),
                                updateSkill.getProfession(),
                                updateSkill.getMinXP());
                    s.id = updateSkill.getId();
                    ss.update(s);
                    break;
                case "find":
                    if(findCommand.getType().equals("skill"))
                        System.out.println("Returned object: " + ss.getById(findCommand.getId()));
                    else
                        System.out.println("Returned object: " + rs.getById(findCommand.getId()));
                    break;
                case "delete":
                    if(deleteCommand.getType().equals("skill"))
                    {
                        SkillDTO s1 = new SkillDTO();
                        s1.id = deleteCommand.getId();
                        ss.delete(s1);
                    }
                    else
                    {
View Full Code Here

Examples of cz.muni.fi.pa165.ddtroops.dto.SkillDTO

        rt.setMessageConverters(l);
    }
   
    @Override
    public SkillDTO createNewSkill(String name, String description, String profession, Long minXP) {
        SkillDTO skill = new SkillDTO();
        skill.name = name;
        skill.description = description;
        skill.profession = profession;
        skill.minXP = minXP;
        return skill;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.