{"id":718,"date":"2023-12-16T18:18:20","date_gmt":"2023-12-16T18:18:20","guid":{"rendered":"https:\/\/emorah.com\/story\/?p=718"},"modified":"2023-12-16T18:18:22","modified_gmt":"2023-12-16T18:18:22","slug":"spring-boot-framework-fresco-play-solutions","status":"publish","type":"post","link":"https:\/\/emorah.com\/story\/fresco-play\/spring-boot-framework-fresco-play-solutions\/","title":{"rendered":"Spring Boot Framework Fresco Play Solutions"},"content":{"rendered":"\n<p><strong>Spring Boot Framework Fresco Play Solutions<\/strong><\/p>\n\n\n\n<p>Spring Boot is a Java-Based Framework for building Microservices.&nbsp;The Course Id is&nbsp;<strong>55960.&nbsp;<\/strong>It is not difficult to clear the final Assignment. But of the members difficult to feel to clear the hands-on Questions. These Answers are very helpful who are stuck to clear those questions.&nbsp;<\/p>\n\n\n\n<h3>1. Sorting list of Candidates<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjjoIorRtXMm10-lZRyUOd76CqwYGLt9Uq7QVeZhjHz7WNw2N5UWUUiDsupjB3SGcwzpn9gcw8DilcZAIlJyeF82j9GFDHh6axO-WiQs6T9tGnnBDOxYENY9-K8dgskFaBeICfVW38zYzI\/s607\/Sorting+List+of+Candidates+.png\"><img src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjjoIorRtXMm10-lZRyUOd76CqwYGLt9Uq7QVeZhjHz7WNw2N5UWUUiDsupjB3SGcwzpn9gcw8DilcZAIlJyeF82j9GFDHh6axO-WiQs6T9tGnnBDOxYENY9-K8dgskFaBeICfVW38zYzI\/w640-h322\/Sorting+List+of+Candidates+.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>1.E mployee.java\n\npackage com.example.demo.employee;\npublic class Employee implements Comparable &lt; Employee &gt; {\n\n    private String name;\n    private int age;\n    private int exp;\n    public int getAge() {\n        return age;\n    }\n    public void setAge(int age) {\n        this.age = age;\n    }\n    public int getExp() {\n        return exp;\n    }\n    public void setExp(int exp) {\n        this.exp = exp;\n    }\n    public String getName() {\n        return name;\n    }\n    public void setName(String name) {\n        this.name = name;\n    }\n    public Employee(String name, int age, int exp) {\n        super();\n        this.name = name;\n        this.age = age;\n        this.exp = exp;\n    }\n    public Employee() {}\n\n    @Override\n    public int compareTo(Employee emp) {\n        \/\/replace your comparator here\n        return (this.getAge() - emp.getAge());\n    }\n\n\n\n    2.E mployeeController\n\n\n\n    package com.example.demo.employee;\n    import java.util.Collections;\n    import java.util.List;\n\n    import org.springframework.beans.factory.annotation.Autowired;\n    import org.springframework.web.bind.annotation.RequestMapping;\n    import org.springframework.web.bind.annotation.RestController;\n    import java.util.ArrayList;\n    @RestController\n    public class EmployeeController {\n        @Autowired\n        private EmployeeService emp;\n        \/\/Put your code here\n        @RequestMapping(\"\/\")\n        public List &lt; Employee &gt; getEmpList() {\n            \/\/Put your code here\n            List &lt; Employee &gt; e = emp.getEmployees();\n            Collections.sort(e);\n            return e;\n        }\n\n    }\n\n\n    3.E mployeeService.java\n\n\n    package com.example.demo.employee;\n\n    import java.util.Arrays;\n\n    import org.springframework.stereotype.Service;\n    import java.util.List;\n    import java.util.ArrayList;\n\n    @Service\n    public class EmployeeService {\n\n        public List &lt; Employee &gt; getEmployees() {\n            final List &lt; Employee &gt; demo = new ArrayList &lt; &gt; ();\n            demo.add(new Employee(\"Sandhya\", 20, 0));\n            demo.add(new Employee(\"Kemp\", 24, 2));\n            demo.add(new Employee(\"Anil\", 22, 3));\n            demo.add(new Employee(\"Kumar\", 30, 6));\n            demo.add(new Employee(\"Tim\", 32, 7));\n\n\n            return demo;\n        }\n    }\n\n}<\/code><\/pre>\n\n\n\n<h3><strong>2. Accessing Values from the application. properties.file<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhKh8e_kH08PQ9UMNFAx0ZPWkjFtxO9NKI-Mb_LNXPA-olaglAGJaJPlg3IQNB0UoMMoBEQfuB6mUWXLBgqY4YXdKPLQq1KSYy4T4_LeRCDsRzHe_yVvKlAcG63ip7ZEkWBdEvborYIOYw\/s607\/Application.Properties.file+.png\"><img src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhKh8e_kH08PQ9UMNFAx0ZPWkjFtxO9NKI-Mb_LNXPA-olaglAGJaJPlg3IQNB0UoMMoBEQfuB6mUWXLBgqY4YXdKPLQq1KSYy4T4_LeRCDsRzHe_yVvKlAcG63ip7ZEkWBdEvborYIOYw\/w640-h326\/Application.Properties.file+.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p><strong>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;fresco-course = Spring Boot<\/strong><\/p>\n\n\n\n<h3>3) Print contents of the list along the sublist<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEimaFf-_YD7HP9upWiAbwmSO_VOrKjdPTxVJMxlglkELZGeLSoEUWbwbsw-IZlCrV9p0vYo27YFPzNrYeIfYHY7YbCpjIa5t-Q7e_QdHcTBlKbe0mp0JgGSxkFte40vaafgBkiEyj5geEM\/s608\/Print+contents+of+list+along+the+sublist.png\"><img src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEimaFf-_YD7HP9upWiAbwmSO_VOrKjdPTxVJMxlglkELZGeLSoEUWbwbsw-IZlCrV9p0vYo27YFPzNrYeIfYHY7YbCpjIa5t-Q7e_QdHcTBlKbe0mp0JgGSxkFte40vaafgBkiEyj5geEM\/w640-h326\/Print+contents+of+list+along+the+sublist.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>ContentController.java<\/p>\n\n\n\n<p>package com.example.demo.content;<\/p>\n\n\n\n<p>import java.util.List;<br>import org.springframework.web.bind.annotation.RestController;<br>import org.springframework.beans.factory.annotation.Autowired;<br>import org.springframework.web.bind.annotation.RequestMapping;<\/p>\n\n\n\n<p>@RestController<br>public class ContentController {<br>\/\/Put your code here.<br>@Autowired<br>private ContentService cs;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@RequestMapping(\"\/\")\npublic List &lt; Category &gt; getContentList() {\n    List &lt; Category &gt; c = cs.getAllContent();\n    return c;\n}<\/code><\/pre>\n\n\n\n<p>}<\/p>\n\n\n\n<p>ContentService.java<\/p>\n\n\n\n<p>package com.example.demo.content;<\/p>\n\n\n\n<p>import java.util.Arrays;<br>import java.util.List;<br>import java.util.ArrayList;<\/p>\n\n\n\n<p>import org.springframework.stereotype.Service;<\/p>\n\n\n\n<p>@Service<br>public class ContentService {<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/put your code here.\npublic List &lt; Category &gt; categories = new ArrayList &lt; &gt; ();\n\npublic List &lt; Category &gt; getAllContent() {\n\n    List &lt; Course &gt; courses = new ArrayList &lt; &gt; ();\n    courses.add(new Course(1, \"Coursename\", 200, 200, 1001));\n    courses.add(new Course(2, \"Coursename\", 200, 200, 1001));\n    courses.add(new Course(3, \"Coursename\", 200, 200, 1001));\n\n    List &lt; Category &gt; categories = new ArrayList &lt; &gt; ();\n\n    categories.add(new Category(1001, \"Cloud Computing\", \"network of remote servers hosted on the internet to store\", courses));\n    categories.add(new Category(1002, \"Software\", \"network of remote servers hosted on the internet to store\", courses));\n    categories.add(new Category(1003, \"Networking\", \"network of remote servers hosted on the internet to store\", courses));\n\n    return categories;\n}<\/code><\/pre>\n\n\n\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spring Boot Framework Fresco Play Solutions Spring Boot is a Java-Based Framework for building Microservices.&nbsp;The Course Id is&nbsp;55960.&nbsp;It is not difficult to clear the final Assignment. But of the members difficult to feel to clear the hands-on Questions. These Answers are very helpful who are stuck to clear those questions.&nbsp; [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":663,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":""},"categories":[156],"tags":[],"_links":{"self":[{"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/posts\/718"}],"collection":[{"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/comments?post=718"}],"version-history":[{"count":4,"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/posts\/718\/revisions"}],"predecessor-version":[{"id":722,"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/posts\/718\/revisions\/722"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/media\/663"}],"wp:attachment":[{"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/media?parent=718"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/categories?post=718"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emorah.com\/story\/wp-json\/wp\/v2\/tags?post=718"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}