<commit_before>package com.brahalla.PhotoAlbum.controller.rest;

import com.brahalla.PhotoAlbum.domain.Photo;
import com.brahalla.PhotoAlbum.model.PhotoInfo;
import com.brahalla.PhotoAlbum.service.PhotoService;

import java.util.List;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("photos")
public class PhotoController {

	@Autowired
	PhotoService photoService;

	/* CREATE - create a photo
	 * REQUEST: POST /api/photos
	 */
  @RequestMapping(method = RequestMethod.POST)
  public Photo createPhoto(@Valid @RequestBody PhotoInfo photoInfo) {
    return this.photoService.createPhoto(photoInfo);
  }

	/* READ - read a photo
	 * REQUEST: GET /api/photos/{id}
	 */
  @RequestMapping(value = "{id}", method = RequestMethod.GET)
  public Photo getPhotoById(@PathVariable("id") Long id) {
    return this.photoService.getPhotoById(id);
  }

	/* READ - read all photos
	 * REQUEST: GET /api/photos
	 */
	@RequestMapping(method = RequestMethod.GET)
	public List<Photo> getPhotoList() {
		return this.photoService.getPhotoList();
	}

	/* READ - read photos with matching albumId
	 * REQUEST: GET /api/photos?albumId={id}
	 */
	@RequestMapping(method = RequestMethod.GET)
	public List<Photo> getPhotoListByAlbumId(@RequestParam(value = "albumId") String albumId) {
		return this.photoService.getPhotoListByAlbumId(Long.valueOf(albumId));
	}<commit_msg>hmmmmm<commit_after>package com.brahalla.PhotoAlbum.controller.rest;

import com.brahalla.PhotoAlbum.domain.Photo;
import com.brahalla.PhotoAlbum.model.PhotoInfo;
import com.brahalla.PhotoAlbum.service.PhotoService;

import java.util.List;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("photos")
public class PhotoController {

	@Autowired
	PhotoService photoService;

	/* CREATE - create a photo
	 * REQUEST: POST /api/photos
	 */
  @RequestMapping(method = RequestMethod.POST)
  public Photo createPhoto(@Valid @RequestBody PhotoInfo photoInfo) {
    return this.photoService.createPhoto(photoInfo);
  }

	/* READ - read a photo
	 * REQUEST: GET /api/photos/{id}
	 */
  @RequestMapping(value = "{id}", method = RequestMethod.GET)
  public Photo getPhotoById(@PathVariable("id") Long id) {
    return this.photoService.getPhotoById(id);
  }

	/* READ - read all photos
	 * REQUEST: GET /api/photos
	 */
	@RequestMapping(method = RequestMethod.GET)
	public List<Photo> getPhotoList(@RequestParam(value = "albumId", required = false) String albumId) {
		if (albumId) {
			return this.photoService.getPhotoListByAlbumId(Long.valueOf(albumId));
		} else {
			return this.photoService.getPhotoList();
		}
	}

	/* READ - read photos with matching albumId
	 * REQUEST: GET /api/photos?albumId={id}
	 */
	/*@RequestMapping(method = RequestMethod.GET)
	public List<Photo> getPhotoListByAlbumId(@RequestParam(value = "albumId") String albumId) {
		return this.photoService.getPhotoListByAlbumId(Long.valueOf(albumId));
	}*/
{'fraction_non_alphanumeric': 0.11580345285524568, 'fraction_numerical': 0.0, 'mean_word_length': 5.297658862876254, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6649639', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1106, 'n_words': 214}