Changeset f194b4e


Ignore:
Timestamp:
03/04/23 19:33:53 (21 months ago)
Author:
GitHub <noreply@…>
Branches:
main
Children:
8b7dd7f, eac569a
Parents:
eef07ff (diff), 4103eaa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
SazdovaEkaterina <74919977+SazdovaEkaterina@…> (03/04/23 19:33:53)
git-committer:
GitHub <noreply@…> (03/04/23 19:33:53)
Message:

Merge pull request #7 from SazdovaEkaterina/create-post

Create Post

Location:
Prototype Application/Paw5/src/main
Files:
7 added
7 edited

Legend:

Unmodified
Added
Removed
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Pet.java

    reef07ff rf194b4e  
    4343
    4444    @Column(name = "id_adoption")
    45     private int adoptionId;
     45    private Integer adoptionId;
    4646
    4747    @Column(name = "id_shelter")
    48     private int shelterId;
     48    private Integer shelterId;
    4949
    50     public Pet(String imageUrl, AgeGroup ageGroup, Size size, String breed, String name, Species species, Gender gender, boolean canBeFostered, int adoptionId, int shelterId) {
     50    public Pet(String imageUrl, AgeGroup ageGroup, Size size, String breed, String name, Species species, Gender gender, boolean canBeFostered, Integer adoptionId, Integer shelterId) {
    5151        this.imageUrl = imageUrl;
    5252        this.ageGroup = ageGroup;
  • Prototype Application/Paw5/src/main/java/finki/paw5/model/entities/Post.java

    reef07ff rf194b4e  
    55
    66import java.time.LocalDate;
    7 import java.util.Date;
    87
    98@Data
     
    2423
    2524    @Column(name="id_pet", nullable = false)
    26     private int petId;
     25    private Integer petId;
    2726
    2827    @Column(name="id_surendee")
    29     private int surendeeId;
     28    private Integer surendeeId;
    3029
    3130    @Column(name="id_employee")
    32     private int employeeId;
     31    private Integer employeeId;
    3332
    34     public Post(LocalDate dateCreated, String thumbnailUrl, int petId, int surendeeId, int employeeId) {
     33    public Post(LocalDate dateCreated, String thumbnailUrl, Integer petId, Integer surendeeId, Integer employeeId) {
    3534        this.dateCreated = dateCreated;
    3635        this.thumbnailUrl = thumbnailUrl;
  • Prototype Application/Paw5/src/main/java/finki/paw5/web/controllers/HomeController.java

    reef07ff rf194b4e  
    11package finki.paw5.web.controllers;
    22
     3import jakarta.servlet.http.HttpServletRequest;
    34import org.springframework.stereotype.Controller;
    45import org.springframework.web.bind.annotation.GetMapping;
     
    1011
    1112    @GetMapping
    12     public String getHomePage(){
     13    public String getHomePage(HttpServletRequest request) {
     14        if(request.getSession().getAttribute("user")==null){
     15            return "redirect:/login";
     16        }
    1317        return "home";
    1418    }
     19
    1520    @GetMapping("/aboutUs")
    16     public String getSuccessPage(){
     21    public String getSuccessPage() {
    1722        return "/aboutUs";
    1823    }
  • Prototype Application/Paw5/src/main/resources/templates/aboutUs.html

    reef07ff rf194b4e  
    11<!DOCTYPE html>
    2 <html lang="en">
     2<html lang="en" xmlns:th="http://thymeleaf.org">
    33<head>
    44    <meta charset="UTF-8">
  • Prototype Application/Paw5/src/main/resources/templates/home.html

    reef07ff rf194b4e  
    11<!DOCTYPE html>
    2 <html lang="en">
     2<html lang="en" xmlns:th="http://thymeleaf.org">
    33<head>
    44    <meta charset="UTF-8">
     
    3535  </nav>
    3636</header>
    37 
     37<div>
     38  <form method="get" th:action="@{'/create-post'}">
     39    <button id="submit" type="submit">Create an Adoption Post</button>
     40  </form>
     41</div>
    3842<div>
    3943  <h1>Welcome to Paw 5</h1>
  • Prototype Application/Paw5/src/main/resources/templates/login.html

    reef07ff rf194b4e  
    11<!DOCTYPE html>
    2 <html lang="en">
     2<html lang="en" xmlns:th="http://thymeleaf.org">
    33<head>
    44  <meta charset="UTF-8">
  • Prototype Application/Paw5/src/main/resources/templates/register.html

    reef07ff rf194b4e  
    11<!DOCTYPE html>
    2 <html lang="en" xmlns:th="http://www.thymeleaf.org">
     2<html lang="en" xmlns:th="http://thymeleaf.org">
    33<head>
    44    <meta charset="UTF-8">
Note: See TracChangeset for help on using the changeset viewer.