Skip to content
Snippets Groups Projects
Commit 8065e9e0 authored by saleem raja's avatar saleem raja
Browse files

assignment

parent 8d8a53d8
No related branches found
No related tags found
No related merge requests found
Pipeline #2063 failed
......@@ -14,7 +14,7 @@
<name>springboot-assignment</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>17</java.version>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
......@@ -77,6 +77,7 @@
</configuration>
</plugin>
</plugins>
<finalName>java-app</finalName>
</build>
</project>
package com.tcs.assignment.springbootassignment;
import com.tcs.assignment.springbootassignment.model.AssignmentModel;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@SpringBootApplication
public class SpringbootAssignmentApplication {
......
package com.tcs.assignment.springbootassignment.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class WebSecurity {
private static final String[] WHITE_LIST_URLS = {
"/createuser"
};
// @Bean
// public PasswordEncoder passwordEncoder() {
// return new BCryptPasswordEncoder(11);
// }
// SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
// http.cors()
// .and()
// .csrf()
// .disable()
// .authorizeHttpRequests();
//
//
// }
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import com.tcs.assignment.springbootassignment.entity.User;
import jakarta.validation.constraints.Pattern;
import lombok.Builder;
import lombok.Data;
import org.springframework.web.bind.annotation.ResponseStatus;
import java.util.ArrayList;
import java.util.Date;
......@@ -11,6 +12,7 @@ import java.util.List;
@Data
@Builder
@ResponseStatus
public class AssignmentModel {
private String title;
......
package com.tcs.assignment.springbootassignment.repository;
import com.tcs.assignment.springbootassignment.entity.Assignment;
import com.tcs.assignment.springbootassignment.entity.User;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
......
......@@ -45,7 +45,7 @@ public class UserServiceImp implements UserService {
assignment1.setDueDate(format.format(assignment.getDueDate()));
// System.out.println(assignment.getUserList().get(0).getId());
List users = assignment.getUserList();
List<User> users = assignment.getUserList();
List<Long> jsonUserId = new ArrayList<>();
System.out.println(users);
for (Object user : users) {
......@@ -96,7 +96,7 @@ public class UserServiceImp implements UserService {
@Override
public void updateAssignment(Long id, AssignmentModel assignmentModel) {
System.out.println(assignmentModel);
UserModel userModel = new UserModel();
// UserModel userModel = new UserModel();
Assignment assignment = assignmentRepository.findById(id).get();
SimpleDateFormat format = new SimpleDateFormat("dd-MM-yyyy");
if (Objects.nonNull(assignmentModel.getTitle()) && !"".equalsIgnoreCase(assignmentModel.getTitle())) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment