// Path: linkshortener-web/src/main/java/be/drissamri/model/Link.java
// public class Link {
//   private String url;
//   private String hash;
//   private String shortUrl;
// 
//   public Link(String shortUrl, String url, String hash) {
//     this.shortUrl = shortUrl;
//     this.url = url;
//     this.hash = hash;
//   }
// 
//   public Link() {
// 
//   }
// 
//   public String getUrl() {
//     return url;
//   }
// 
//   public void setUrl(String url) {
//     this.url = url;
//   }
// 
//   public String getShortUrl() {
//     return shortUrl;
//   }
// 
//   public void setShortUrl(String shortUrl) {
//     this.shortUrl = shortUrl;
//   }
// 
//   public String getHash() {
//     return hash;
//   }
// 
//   public void setHash(String hash) {
//     this.hash = hash;
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hashCode(url);
//   }
// 
//   @Override
//   public boolean equals(Object obj) {
//     if (this == obj) {
//       return true;
//     }
//     if (obj == null || getClass() != obj.getClass()) {
//       return false;
//     }
//     final Link other = (Link) obj;
//     return Objects.equals(this.url, other.url) && Objects.equals(this.shortUrl, other.shortUrl);
//   }
// }
// 
// Path: linkshortener-api/src/main/java/be/drissamri/service/LinkService.java
// public interface LinkService {
//   List<LinkEntity> find(int offset, int limit);
// 
//   LinkEntity create(String url);
// 
//   String findUrlByHash(String hash);
// 
//   void deleteByHash(String hash);
// }


import be.drissamri.model.Link;
import be.drissamri.service.LinkService;
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;
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 Driss Amri
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package be.drissamri.controller;


@RestController
public class LinkController {
// Path: linkshortener-web/src/main/java/be/drissamri/model/Link.java
// public class Link {
//   private String url;
//   private String hash;
//   private String shortUrl;
// 
//   public Link(String shortUrl, String url, String hash) {
//     this.shortUrl = shortUrl;
//     this.url = url;
//     this.hash = hash;
//   }
// 
//   public Link() {
// 
//   }
// 
//   public String getUrl() {
//     return url;
//   }
// 
//   public void setUrl(String url) {
//     this.url = url;
//   }
// 
//   public String getShortUrl() {
//     return shortUrl;
//   }
// 
//   public void setShortUrl(String shortUrl) {
//     this.shortUrl = shortUrl;
//   }
// 
//   public String getHash() {
//     return hash;
//   }
// 
//   public void setHash(String hash) {
//     this.hash = hash;
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hashCode(url);
//   }
// 
//   @Override
//   public boolean equals(Object obj) {
//     if (this == obj) {
//       return true;
//     }
//     if (obj == null || getClass() != obj.getClass()) {
//       return false;
//     }
//     final Link other = (Link) obj;
//     return Objects.equals(this.url, other.url) && Objects.equals(this.shortUrl, other.shortUrl);
//   }
// }
// 
// Path: linkshortener-api/src/main/java/be/drissamri/service/LinkService.java
// public interface LinkService {
//   List<LinkEntity> find(int offset, int limit);
// 
//   LinkEntity create(String url);
// 
//   String findUrlByHash(String hash);
// 
//   void deleteByHash(String hash);
// }


// Path: linkshortener-web/src/main/java/be/drissamri/controller/LinkController.java
import be.drissamri.model.Link;
import be.drissamri.service.LinkService;
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;

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014 Driss Amri
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package be.drissamri.controller;


@RestController
public class LinkController {
  private final LinkService service;